Tensorflow :: ops :: FakeQuantWithMinMaxArgs
#include <array_ops.h>
Quantisieren Sie den Tensor "Eingänge" falsch, geben Sie float in den Tensor "Ausgänge" des gleichen Typs ein.
Zusammenfassung
Attribute [min; max]
Definieren Sie den Klemmbereich für die inputs
. inputs
Werte werden in den Quantisierungsbereich quantisiert ( [0; 2^num_bits - 1]
, wenn narrow_range
ist falsch und [1; 2^num_bits - 1]
, wenn es wahr ist ) , und dann de-quantisiert und ausgegeben als Schwimmer in [min; max]
Intervall. num_bits
ist die Bitbreite der Quantisierung; zwischen 2 und 16 einschließlich.
Vor der Quantisierung werden die min
und max
Werte mit der folgenden Logik angepasst. Es wird empfohlen, min <= 0 <= max
. Wenn 0
nicht im Wertebereich liegt, kann das Verhalten unerwartet sein: Wenn 0 < min < max
: min_adj = 0
und max_adj = max - min
. Wenn min < max < 0
: min_adj = min - max
und max_adj = 0
. Wenn min <= 0 <= max
: scale = (max - min) / (2^num_bits - 1)
, min_adj = scale * round(min / scale)
und max_adj = max + min_adj - min
.
Die Quantisierung wird als Fälschung bezeichnet, da sich die Ausgabe noch im Gleitkomma befindet.
Argumente:
- scope: Ein Scope- Objekt
Kehrt zurück:
-
Output
: Der Ausgangstensor.
Konstruktoren und Destruktoren | |
---|---|
FakeQuantWithMinMaxArgs (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs) | |
FakeQuantWithMinMaxArgs (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, const FakeQuantWithMinMaxArgs::Attrs & attrs) |
Öffentliche Attribute | |
---|---|
operation | |
outputs |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche statische Funktionen | |
---|---|
Max (float x) | |
Min (float x) | |
NarrowRange (bool x) | |
NumBits (int64 x) |
Strukturen | |
---|---|
tensorflow :: ops :: FakeQuantWithMinMaxArgs :: Attrs | Optionale Attributsetzer für FakeQuantWithMinMaxArgs . |
Öffentliche Attribute
Operation
Operation operation
Ausgänge
::tensorflow::Output outputs
Öffentliche Funktionen
FakeQuantWithMinMaxArgs
FakeQuantWithMinMaxArgs( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs )
FakeQuantWithMinMaxArgs
FakeQuantWithMinMaxArgs( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, const FakeQuantWithMinMaxArgs::Attrs & attrs )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const
Öffentliche statische Funktionen
Max
Attrs Max( float x )
Mindest
Attrs Min( float x )
Engen Bereich
Attrs NarrowRange( bool x )
NumBits
Attrs NumBits( int64 x )