コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦:: FakeQuantWithMinMaxArgs
#include <array_ops.h>
「入力」テンソルを疑似量子化し、同じ型の「出力」テンソルに float 型を入力します。
まとめ
属性[min; max]
inputs
データのクランプ範囲を定義します。 inputs
値は量子化範囲 ( narrow_range
が false の場合は[0; 2^num_bits - 1]
、true の場合は[1; 2^num_bits - 1]
) に量子化され、その後量子化解除され、 [min; max]
間隔。 num_bits
量子化のビット幅です。 2 から 16 まで (両端の値を含む)
量子化の前に、 min
とmax
値は次のロジックで調整されます。 min <= 0 <= max
にすることをお勧めします。 0
が値の範囲内にない場合、予期しない動作が発生する可能性があります: 0 < min < max
の場合: min_adj = 0
およびmax_adj = max - min
。 min < max < 0
の場合: min_adj = min - max
およびmax_adj = 0
。 min <= 0 <= max
場合: scale = (max - min) / (2^num_bits - 1)
、 min_adj = scale * round(min / scale)
、 max_adj = max + min_adj - min
。
出力が浮動小数点のままであるため、量子化はフェイクと呼ばれます。
引数:
戻り値:
パブリック属性
公共機能
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
狭い範囲
Attrs NarrowRange(
bool x
)
ビット数
Attrs NumBits(
int64 x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],null,["# tensorflow::ops::FakeQuantWithMinMaxArgs Class Reference\n\ntensorflow::ops::FakeQuantWithMinMaxArgs\n========================================\n\n`#include \u003carray_ops.h\u003e`\n\nFake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type.\n\nSummary\n-------\n\nAttributes `[min; max]` define the clamping range for the `inputs` data. `inputs` values are quantized into the quantization range (`[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` when it is true) and then de-quantized and output as floats in `[min; max]` interval. `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.\n\nBefore quantization, `min` and `max` values are adjusted with the following logic. It is suggested to have `min \u003c= 0 \u003c= max`. If `0` is not in the range of values, the behavior can be unexpected: If `0 \u003c min \u003c max`: `min_adj = 0` and `max_adj = max - min`. If `min \u003c max \u003c 0`: `min_adj = min - max` and `max_adj = 0`. If `min \u003c= 0 \u003c= max`: `scale = (max - min) / (2^num_bits - 1)`, `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`.\n\nQuantization is called fake since the output is still in floating point.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The outputs tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [FakeQuantWithMinMaxArgs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a85e03d1dc3cd4bc32cd221b7b9cf6d9a)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs)` ||\n| [FakeQuantWithMinMaxArgs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a5a50c94e0d72103df198cd3f00bed13d)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs, const `[FakeQuantWithMinMaxArgs::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a74ebb70c787d9ab49c7e4f6a25a1caba) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [outputs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a9f9cb032ade7705f0b4a03b0ab94cb0c) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1adf0a81f8d2e49f0bf4eb5859fac39168)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a51cf8e44b3b26ce30a5016a440b99c69)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a614548643c093eefd86990ce72baece3)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Max](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a5e82983f6429be0078510aea65c1593b)`(float x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs) |\n| [Min](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a3fd5bd826632651830791d26c59fb56f)`(float x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs) |\n| [NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a9af5fd9211a71acf844cf8d911fde2ac)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs) |\n| [NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a80f557e9c790845a7e5c910bae0ef5fd)`(int64 x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs) | Optional attribute setters for [FakeQuantWithMinMaxArgs](/versions/r2.2/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### outputs\n\n```text\n::tensorflow::Output outputs\n``` \n\nPublic functions\n----------------\n\n### FakeQuantWithMinMaxArgs\n\n```gdscript\n FakeQuantWithMinMaxArgs(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs\n)\n``` \n\n### FakeQuantWithMinMaxArgs\n\n```gdscript\n FakeQuantWithMinMaxArgs(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n const FakeQuantWithMinMaxArgs::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Max\n\n```text\nAttrs Max(\n float x\n)\n``` \n\n### Min\n\n```text\nAttrs Min(\n float x\n)\n``` \n\n### NarrowRange\n\n```text\nAttrs NarrowRange(\n bool x\n)\n``` \n\n### NumBits\n\n```text\nAttrs NumBits(\n int64 x\n)\n```"]]