Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
tensor akışı:: işlem:: FakeQuantWithMinMaxArgs
#include <array_ops.h>
'Girişler' tensörünü sahte nicemleyin, aynı türdeki 'çıkışlar' tensörüne float yazın.
Özet
Nitelikler [min; max]
inputs
verileri için sıkıştırma aralığını tanımlar. inputs
değerleri niceleme aralığına nicemlenir ( narrow_range
yanlış olduğunda [0; 2^num_bits - 1]
ve doğru olduğunda [1; 2^num_bits - 1]
) ve ardından kuantizasyondan arındırılır ve [min; max]
aralık. num_bits
nicelemenin bit genişliğidir; 2 ile 16 arasında (dahil).
Kuantizasyondan önce min
ve max
değerler aşağıdaki mantıkla ayarlanır. min <= 0 <= max
olması önerilir. 0
değer aralığında değilse davranış beklenmedik olabilir: If 0 < min < max
: min_adj = 0
ve max_adj = max - min
. min < max < 0
ise: min_adj = min - max
ve max_adj = 0
. min <= 0 <= max
: scale = (max - min) / (2^num_bits - 1)
, min_adj = scale * round(min / scale)
ve max_adj = max + min_adj - min
.
Çıkış hala kayan noktada olduğundan kuantizasyona sahte denir.
Argümanlar:
İade:
Genel özellikler
Kamu işlevleri
düğüm
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const
Genel statik işlevler
Maksimum
Attrs Max(
float x
)
Min.
Attrs Min(
float x
)
Dar Aralık
Attrs NarrowRange(
bool x
)
NumBits
Attrs NumBits(
int64 x
)
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-25 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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/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.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs, const `[FakeQuantWithMinMaxArgs::Attrs](/versions/r2.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-args/attrs) | Optional attribute setters for [FakeQuantWithMinMaxArgs](/versions/r2.1/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```"]]