Tensorflow :: ops :: BroadcastTo
#include <array_ops.h>
Senden Sie ein Array für eine kompatible Form.
Zusammenfassung
Beim Broadcasting werden Arrays so erstellt, dass sie für arithmetische Operationen kompatible Formen haben. Zwei Formen sind kompatibel, wenn sie für jedes Dimensionspaar entweder gleich sind oder eine davon eine ist. Wenn Sie versuchen, einen Tensor an eine Form zu senden, beginnt er mit den nachfolgenden Dimensionen und arbeitet sich vorwärts.
Beispielsweise,
>>> x = tf.constant([1, 2, 3]) >>> y = tf.broadcast_to(x, [3, 3]) >>> sess.run(y) array([[1, 2, 3], [1, 2, 3], [1, 2, 3]], dtype=int32)
In dem obigen Beispiel wird das Eingang Tensor mit der Form von [1, 3]
ist mit dem Ausgang gesendet Tensor mit Form von [3, 3]
.
Argumente:
- scope: Ein Scope- Objekt
- Eingabe: Ein zu sendender Tensor .
- Form: Ein 1-D
int
Tensor . Die Form der gewünschten Ausgabe.
Kehrt zurück:
Konstruktoren und Destruktoren | |
---|---|
BroadcastTo (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input shape) |
Öffentliche Attribute | |
---|---|
operation | |
output |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche Attribute
Operation
Operation operation
Ausgabe
::tensorflow::Output output
Öffentliche Funktionen
BroadcastTo
BroadcastTo( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input shape )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const