संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: क्वांटाइज़डाउनएंडश्रिंकरेंज
#include <math_ops.h>
का उपयोग करके परिमाणित 'इनपुट' टेंसर को कम परिशुद्धता वाले 'आउटपुट' में परिवर्तित करें।
सारांश
निचली बिट गहराई के उपयोग को अधिकतम करने और आउटपुट न्यूनतम और अधिकतम श्रेणियों को तदनुसार समायोजित करने के लिए मूल्यों का वास्तविक वितरण।
[इनपुट_मिन, इनपुट_मैक्स] स्केलर फ़्लोट हैं जो 'इनपुट' डेटा की फ़्लोट व्याख्या के लिए सीमा निर्दिष्ट करते हैं। उदाहरण के लिए, यदि इनपुट_मिन -1.0f है और इनपुट_मैक्स 1.0f है, और हम quint16 परिमाणित डेटा के साथ काम कर रहे हैं, तो 16-बिट डेटा में 0 मान को -1.0f के रूप में समझा जाना चाहिए, और 65535 का अर्थ 1.0f है।
यह ऑपरेटर डेटा में पाए जाने वाले वास्तविक न्यूनतम और अधिकतम मानों की गणना करके कम बिट गहराई वाले आउटपुट में यथासंभव सटीकता निचोड़ने का प्रयास करता है। उदाहरण के लिए, हो सकता है कि क्विंट16 इनपुट का कोई मान 16,384 से कम न हो और 49,152 से अधिक न हो। इसका मतलब है कि वास्तव में केवल आधी सीमा की आवश्यकता है, सभी फ्लोट व्याख्याएं -0.5f और 0.5f के बीच हैं, इसलिए यदि हम डेटा को क्विंट 8 आउटपुट में संपीड़ित करना चाहते हैं, तो हम सैद्धांतिक -1.0f से 1.0 के बजाय उस सीमा का उपयोग कर सकते हैं f जो इनपुट न्यूनतम और अधिकतम द्वारा सुझाया गया है।
व्यवहार में, यह क्वांटाइज्डमैटमुल जैसे ऑपरेशन से आउटपुट लेने के लिए सबसे उपयोगी है जो अपने इनपुट की तुलना में अधिक बिट-गहराई वाले आउटपुट का उत्पादन कर सकता है और इसमें बड़ी संभावित आउटपुट रेंज हो सकती हैं, लेकिन व्यवहार में इनपुट मानों का वितरण होता है जो केवल एक छोटे से अंश का उपयोग करता है संभावित सीमा. उस आउटपुट को इस ऑपरेटर में फीड करके, हम सटीकता के न्यूनतम नुकसान के साथ इसे 32 बिट से घटाकर 8 कर सकते हैं।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- इनपुट_मिनट: फ़्लोट मान जो न्यूनतम परिमाणित इनपुट मान दर्शाता है।
- इनपुट_मैक्स: फ़्लोट मान जो अधिकतम परिमाणित इनपुट मान दर्शाता है।
- आउट_टाइप: आउटपुट का प्रकार। टिनपुट की तुलना में थोड़ी गहराई कम होनी चाहिए।
रिटर्न:
-
Output
आउटपुट -
Output
आउटपुट_मिन: फ्लोट मान जो न्यूनतम परिमाणित आउटपुट मान दर्शाता है। -
Output
आउटपुट_मैक्स: फ्लोट मान जो अधिकतम परिमाणित आउटपुट मान दर्शाता है।
सार्वजनिक गुण
सार्वजनिक समारोह
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::QuantizeDownAndShrinkRange Class Reference\n\ntensorflow::ops::QuantizeDownAndShrinkRange\n===========================================\n\n`#include \u003cmath_ops.h\u003e`\n\nConvert the quantized 'input' tensor into a lower-precision 'output', using the.\n\nSummary\n-------\n\nactual distribution of the values to maximize the usage of the lower bit depth and adjusting the output min and max ranges accordingly.\n\n\\[input_min, input_max\\] are scalar floats that specify the range for the float interpretation of the 'input' data. For example, if input_min is -1.0f and input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f.\n\nThis operator tries to squeeze as much precision as possible into an output with a lower bit depth by calculating the actual min and max values found in the data. For example, maybe that quint16 input has no values lower than 16,384 and none higher than 49,152. That means only half the range is actually needed, all the float interpretations are between -0.5f and 0.5f, so if we want to compress the data into a quint8 output, we can use that range rather than the theoretical -1.0f to 1.0f that is suggested by the input min and max.\n\nIn practice, this is most useful for taking output from operations like [QuantizedMatMul](/versions/r1.15/api_docs/cc/class/tensorflow/ops/quantized-mat-mul#classtensorflow_1_1ops_1_1_quantized_mat_mul) that can produce higher bit-depth outputs than their inputs and may have large potential output ranges, but in practice have a distribution of input values that only uses a small fraction of the possible range. By feeding that output into this operator, we can reduce it from 32 bits down to 8 with minimal loss of accuracy.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input_min: The float value that the minimum quantized input value represents.\n- input_max: The float value that the maximum quantized input value represents.\n- out_type: The type of the output. Should be a lower bit depth than Tinput.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_min: The float value that the minimum quantized output value represents.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_max: The float value that the maximum quantized output value represents.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [QuantizeDownAndShrinkRange](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a19ee578c7b888e9aca48d291a1a0d5da)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_min, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_max, DataType out_type)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a3ab13cf6f6f7814f990022d1a49b3a99) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a02ce18813489b86884040f42ddcfca87) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_max](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a3c2857dfc27b8777dc82845ec0a4919a) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_min](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1aa8dddbbd62576e4961029ce5ed846677) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\n### output_max\n\n```scdoc\n::tensorflow::Output output_max\n``` \n\n### output_min\n\n```scdoc\n::tensorflow::Output output_min\n``` \n\nPublic functions\n----------------\n\n### QuantizeDownAndShrinkRange\n\n```gdscript\n QuantizeDownAndShrinkRange(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input input_min,\n ::tensorflow::Input input_max,\n DataType out_type\n)\n```"]]