Broadcast // Operation that produces a tensor based on arg's axes
Description¶
Operation whose output
tensor ignores axes not in the arg
tensor.
Inputs¶
Name 
Element Type 
Shape 


Any 
Any 
Attributes¶
Name 
Type 
Notes 



The shape of the output. 


Axis positions in 
Outputs¶
Name 
Element Type 
Shape 


Same as 
Same as 
The shape of arg
must match shape
with elements in broadcast_axes
removed.
For example, if arg
is \([a, b, c]\) then
Mathematical Definition¶
For a coordinate \(C\), let \(p(C)\) be a coordinate with the
axes in broadcast_axes
removed. For example, if
\(\mathtt{broadcast_axes}=\{1,3\}\) then \(p([d_0, d_1,
d_2, d_3, d_4]) = [d_0, d_2, d_4]\). Then
Backprop¶
C++ Interface¶

class
Broadcast
: public ngraph::op::Op¶ 
Operation which “adds” axes to an input tensor, replicating elements from the input as needed along the new axes.
Subclassed by ngraph::op::v0::BroadcastLike
Public Functions

const NodeTypeInfo &
get_type_info
() const¶ 
Returns the NodeTypeInfo for the node’s class. During transition to type_info, returns a dummy type_info for Node if the class has not been updated yet.

Broadcast
()¶ 
Constructs a broadcast operation.

Broadcast
(const Output<Node> &arg, const Shape &shape, const AxisSet &broadcast_axes)¶ 
Constructs a broadcast operation.
 Parameters

arg
: The input tensor to be broadcast.shape
: The shape of the output tensor.broadcast_axes
: The axis positions (0based) in the result that are being broadcast. The remaining axes in shape must be the same as the shape of arg.

void
validate_and_infer_types
()¶ 
Throws if the node is invalid.

const AxisSet &
get_broadcast_axes
() const¶ 
 Return

A set containing the indices of the broadcast axes (0based).

const NodeTypeInfo &