tensorflow:: ops:: FakeQuantWithMinMaxArgs

#include <array_ops.h>

'inputs'テンソル(float型)を擬似的に量子化し、同じ型の'outputs'テンソルに変換します。

まとめ

属性

  • [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値の範囲に含まれていない場合、予期しない動作が発生する可能性があります。

  • 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 。

量子化は、出力が依然として浮動小数点数であるため、「偽の量子化」と呼ばれます。

議論:

返品:

  • Output :出力テンソル。

コンストラクターとデストラクタ

FakeQuantWithMinMaxArgs (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs)
FakeQuantWithMinMaxArgs (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, const FakeQuantWithMinMaxArgs::Attrs & attrs)

公開属性

operation
outputs

公的機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

パブリック静的関数

Max (float x)
Min (float x)
NarrowRange (bool x)
NumBits (int64 x)

構造

tensorflow:: ops:: FakeQuantWithMinMaxArgs:: Attrs

FakeQuantWithMinMaxArgsのオプション属性セッター。

公開属性

手術

Operation operation

出力

::tensorflow::Output outputs

公的機能

FakeQuantWithMinMaxArgs

 FakeQuantWithMinMaxArgs(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs
)

FakeQuantWithMinMaxArgs

 FakeQuantWithMinMaxArgs(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  const FakeQuantWithMinMaxArgs::Attrs & attrs
)

ノード

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

パブリック静的関数

マックス

Attrs Max(
  float x
)

ミン

Attrs Min(
  float x
)

狭い範囲

Attrs NarrowRange(
  bool x
)

ビット数

Attrs NumBits(
  int64 x
)