संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: FakeQuantWithMinMaxVars
#include <array_ops.h>
वैश्विक फ्लोट स्केलर के माध्यम से फ्लोट प्रकार के 'इनपुट' टेंसर को नकली-मात्राबद्ध करें।
सारांश
वैश्विक फ्लोट स्केलर min
और max
के माध्यम से inputs
के समान आकार के outputs
टेंसर के लिए फ्लोट प्रकार के inputs
टेंसर को नकली-मात्राबद्ध करें।
गुण
-
[min; max]
inputs
डेटा के लिए क्लैंपिंग रेंज को परिभाषित करें। -
inputs
मानों को क्वांटिज़ेशन रेंज में परिमाणित किया जाता है ( [0; 2^num_bits - 1]
जब narrow_range
गलत है और [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
।
इस ऑपरेशन में एक ग्रेडिएंट है और इस प्रकार min
और max
मानों को प्रशिक्षित करने की अनुमति मिलती है।
तर्क:
रिटर्न:
सार्वजनिक गुण
सार्वजनिक समारोह
नोड
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const
सार्वजनिक स्थैतिक कार्य
संकीर्ण रेंज
Attrs NarrowRange(
bool x
)
संख्या बिट्स
Attrs NumBits(
int64 x
)
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::FakeQuantWithMinMaxVars Class Reference\n\ntensorflow::ops::FakeQuantWithMinMaxVars\n========================================\n\n`#include \u003carray_ops.h\u003e`\n\nFake-quantize the 'inputs' tensor of type float via global float scalars.\n\nSummary\n-------\n\nFake-quantize the `inputs` tensor of type float via global float scalars `min` and `max` to `outputs` tensor of same shape as `inputs`.\n\nAttributes\n\n\n- `[min; max]` define the clamping range for the `inputs` data.\n- `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.\n- `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.\n\n\u003cbr /\u003e\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:\n\n\n- If `0 \u003c min \u003c max`: `min_adj = 0` and `max_adj = max - min`.\n- If `min \u003c max \u003c 0`: `min_adj = min - max` and `max_adj = 0`.\n- 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\n\u003cbr /\u003e\n\nThis operation has a gradient and thus allows for training `min` and `max` values.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The outputs tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [FakeQuantWithMinMaxVars](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a00ee58aabd6226983d344471c6956521)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` min, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max)` ||\n| [FakeQuantWithMinMaxVars](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a86e17a607800b4a82880a67535ed4395)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` min, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max, const `[FakeQuantWithMinMaxVars::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1af7b295d43fd540e49c6a4e1621d8ed30) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [outputs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a9fc018d2523132a82d3e60c8e7dc465f) | `::`[tensorflow::Output](/versions/r2.3/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_vars_1a1d4aaa7a38907c46fc2ea3372028d94c)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a384ba596b1a4aebcb314a87e7411fd62)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1ac698bada55ee29951a83182f80ee6395)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1aee3dc1525e2c3837ac1b66757ec20823)`(bool x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs) |\n| [NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a08eae0ee7977569586e1a3fadb261b95)`(int64 x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::FakeQuantWithMinMaxVars::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs) | Optional attribute setters for [FakeQuantWithMinMaxVars](/versions/r2.3/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars). |\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### FakeQuantWithMinMaxVars\n\n```gdscript\n FakeQuantWithMinMaxVars(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n ::tensorflow::Input min,\n ::tensorflow::Input max\n)\n``` \n\n### FakeQuantWithMinMaxVars\n\n```gdscript\n FakeQuantWithMinMaxVars(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n ::tensorflow::Input min,\n ::tensorflow::Input max,\n const FakeQuantWithMinMaxVars::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### NarrowRange\n\n```text\nAttrs NarrowRange(\n bool x\n)\n``` \n\n### NumBits\n\n```text\nAttrs NumBits(\n int64 x\n)\n```"]]