Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient
#include <array_ops.h>
Compute gradients for a FakeQuantWithMinMaxVarsPerChannel operation.
Summary
Args:
- scope: A Scope object
- gradients: Backpropagated gradients above the FakeQuantWithMinMaxVars operation, shape one of:
[d]
, [b, d]
, [b, h, w, d]
.
- inputs: Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape same as
gradients
. min, max: Quantization interval, floats of shape [d]
.
Optional attributes (see Attrs
):
- num_bits: The bitwidth of the quantization; between 2 and 16, inclusive.
- narrow_range: Whether to quantize into 2^num_bits - 1 distinct values.
Returns:
Output
backprops_wrt_input: Backpropagated gradients w.r.t. inputs, shape same as inputs
: gradients * (inputs >= min && inputs <= max)
.
Output
backprop_wrt_min: Backpropagated gradients w.r.t. min parameter, shape [d]
: sum_per_d(gradients * (inputs < min))
.
Output
backprop_wrt_max: Backpropagated gradients w.r.t. max parameter, shape [d]
: sum_per_d(gradients * (inputs > max))
.
Public attributes
Public functions
Public static functions
NarrowRange
Attrs NarrowRange(
bool x
)
NumBits
Attrs NumBits(
int64 x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient Class Reference\n\ntensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient\n==========================================================\n\n`#include \u003carray_ops.h\u003e`\n\nCompute gradients for a [FakeQuantWithMinMaxVarsPerChannel](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel) operation.\n\nSummary\n-------\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- gradients: Backpropagated gradients above the [FakeQuantWithMinMaxVars](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation, shape one of: `[d]`, `[b, d]`, `[b, h, w, d]`.\n- inputs: Values passed as inputs to the [FakeQuantWithMinMaxVars](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation, shape same as `gradients`. min, max: Quantization interval, floats of shape `[d]`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)):\n\n- num_bits: The bitwidth of the quantization; between 2 and 16, inclusive.\n- narrow_range: Whether to quantize into 2\\^num_bits - 1 distinct values.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) backprops_wrt_input: Backpropagated gradients w.r.t. inputs, shape same as `inputs`: `gradients * (inputs \u003e= min && inputs \u003c= max)`.\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) backprop_wrt_min: Backpropagated gradients w.r.t. min parameter, shape `[d]`: `sum_per_d(gradients * (inputs \u003c min))`.\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) backprop_wrt_max: Backpropagated gradients w.r.t. max parameter, shape `[d]`: `sum_per_d(gradients * (inputs \u003e max))`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [FakeQuantWithMinMaxVarsPerChannelGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a7521d0f809a9a2bab753031ec59937a1)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` gradients, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` min, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max)` ||\n| [FakeQuantWithMinMaxVarsPerChannelGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1abf40f598a2e88d6f3a163fc6ac8c5a7d)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` gradients, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` inputs, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` min, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` max, const `[FakeQuantWithMinMaxVarsPerChannelGradient::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [backprop_wrt_max](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1acc9bf06f7b09f2437e913f6f32f6dfe0) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [backprop_wrt_min](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1ae7efb996b2e96e793a55decfaac3bfc4) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [backprops_wrt_input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a99d7e4cadd3a7b374e246edb6cc207fe) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a2054be8cb0cdd3bc1c9721baa5cca289) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a027f51a466b8dcf2dbff757b15dc7200)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs) |\n| [NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1ad2357206b80cb845d85a727dcdd2d022)`(int64 x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs) | Optional attribute setters for [FakeQuantWithMinMaxVarsPerChannelGradient](/versions/r2.14/api_docs/cc/class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient). |\n\nPublic attributes\n-----------------\n\n### backprop_wrt_max\n\n```scdoc\n::tensorflow::Output backprop_wrt_max\n``` \n\n### backprop_wrt_min\n\n```scdoc\n::tensorflow::Output backprop_wrt_min\n``` \n\n### backprops_wrt_input\n\n```scdoc\n::tensorflow::Output backprops_wrt_input\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### FakeQuantWithMinMaxVarsPerChannelGradient\n\n```gdscript\n FakeQuantWithMinMaxVarsPerChannelGradient(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input gradients,\n ::tensorflow::Input inputs,\n ::tensorflow::Input min,\n ::tensorflow::Input max\n)\n``` \n\n### FakeQuantWithMinMaxVarsPerChannelGradient\n\n```gdscript\n FakeQuantWithMinMaxVarsPerChannelGradient(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input gradients,\n ::tensorflow::Input inputs,\n ::tensorflow::Input min,\n ::tensorflow::Input max,\n const FakeQuantWithMinMaxVarsPerChannelGradient::Attrs & attrs\n)\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```"]]