Functions
ngraph.opset3.ops Namespace Reference

Functions

Node assign (NodeInput new_value, str variable_id, Optional[str] name=None)
 Return a node which produces the Assign operation. More...
 
Node broadcast (NodeInput data, NodeInput target_shape, Optional[NodeInput] axes_mapping=None, str broadcast_spec="NUMPY", Optional[str] name=None)
 Create a node which broadcasts the input node's values along specified axes to a desired shape. More...
 
Node bucketize (Node data, NodeInput buckets, str output_type="i64", bool with_right_bound=True, Optional[str] name=None)
 Return a node which produces the Bucketize operation. More...
 
Node cum_sum (NodeInput arg, NodeInput axis, bool exclusive=False, bool reverse=False, Optional[str] name=None)
 Construct a cumulative summation operation. More...
 
Node embedding_bag_offsets_sum (Node emb_table, NodeInput indices, NodeInput offsets, Optional[NodeInput] default_index=None, Optional[NodeInput] per_sample_weights=None, Optional[str] name=None)
 Return a node which performs sums of bags of embeddings without the intermediate embeddings. More...
 
Node embedding_bag_packed_sum (NodeInput emb_table, NodeInput indices, Optional[NodeInput] per_sample_weights=None, Optional[str] name=None)
 Return an EmbeddingBagPackedSum node. More...
 
Node embedding_segments_sum (Node emb_table, NodeInput indices, NodeInput segment_ids, Optional[NodeInput] num_segments=None, Optional[NodeInput] default_index=None, Optional[NodeInput] per_sample_weights=None, Optional[str] name=None)
 Return an EmbeddingSegmentsSum node. More...
 
Node extract_image_patches (NodeInput image, TensorShape sizes, List[int] strides, TensorShape rates, str auto_pad, Optional[str] name=None)
 Return a node which produces the ExtractImagePatches operation. More...
 
Node gru_cell (NodeInput X, NodeInput initial_hidden_state, NodeInput W, NodeInput R, NodeInput B, int hidden_size, List[str] activations=None, List[float] activations_alpha=None, List[float] activations_beta=None, float clip=0.0, bool linear_before_reset=False, Optional[str] name=None)
 Perform GRUCell operation on the tensor from input node. More...
 
Node non_max_suppression (NodeInput boxes, NodeInput scores, Optional[NodeInput] max_output_boxes_per_class=None, Optional[NodeInput] iou_threshold=None, Optional[NodeInput] score_threshold=None, str box_encoding="corner", bool sort_result_descending=True, str output_type="i64", Optional[str] name=None)
 Return a node which performs NonMaxSuppression. More...
 
Node non_zero (NodeInput data, str output_type="i64", Optional[str] name=None)
 Return the indices of the elements that are non-zero. More...
 
Node read_value (NodeInput init_value, str variable_id, Optional[str] name=None)
 Return a node which produces the Assign operation. More...
 
Node rnn_cell (NodeInput X, NodeInput initial_hidden_state, NodeInput W, NodeInput R, NodeInput B, int hidden_size, List[str] activations, List[float] activations_alpha, List[float] activations_beta, float clip=0.0, Optional[str] name=None)
 Perform RNNCell operation on tensor from input node. More...
 
Node roi_align (NodeInput data, NodeInput rois, NodeInput batch_indices, int pooled_h, int pooled_w, int sampling_ratio, float spatial_scale, str mode, Optional[str] name=None)
 Return a node which performs ROIAlign. More...
 
Node scatter_elements_update (NodeInput data, NodeInput indices, NodeInput updates, NodeInput axis, Optional[str] name=None)
 Return a node which produces a ScatterElementsUpdate operation. More...
 
Node scatter_update (Node data, NodeInput indices, NodeInput updates, NodeInput axis, Optional[str] name=None)
 Return a node which produces a ScatterUpdate operation. More...
 
Node shape_of (NodeInput data, str output_type="i64", Optional[str] name=None)
 Return a node which produces a tensor containing the shape of its input data. More...
 
Node shuffle_channels (Node data, int axis, int groups, Optional[str] name=None)
 Perform permutation on data in the channel dimension of the input tensor. More...
 
Node topk (NodeInput data, NodeInput k, int axis, str mode, str sort, str index_element_type="i32", Optional[str] name=None)
 Return a node which performs TopK. More...
 

Function Documentation

◆ assign()

Node ngraph.opset3.ops.assign ( NodeInput  new_value,
str  variable_id,
Optional[str]   name = None 
)

Return a node which produces the Assign operation.

Parameters
new_valueNode producing a value to be assigned to a variable.
variable_idId of a variable to be updated.
nameOptional name for output node.
Returns
Assign node

◆ broadcast()

Node ngraph.opset3.ops.broadcast ( NodeInput  data,
NodeInput  target_shape,
Optional[NodeInput]   axes_mapping = None,
str   broadcast_spec = "NUMPY",
Optional[str]   name = None 
)

Create a node which broadcasts the input node's values along specified axes to a desired shape.

Parameters
dataThe node with input tensor data.
target_shapeThe node with a new shape we want to broadcast tensor to.
axes_mappingThe node with a axis positions (0-based) in the result that are being broadcast.
broadcast_specThe type of broadcasting that specifies mapping of input tensor axes to output shape axes. Range of values: NUMPY, EXPLICIT, BIDIRECTIONAL.
nameOptional new name for output node.
Returns
New node with broadcast shape.

◆ bucketize()

Node ngraph.opset3.ops.bucketize ( Node  data,
NodeInput  buckets,
str   output_type = "i64",
bool   with_right_bound = True,
Optional[str]   name = None 
)

Return a node which produces the Bucketize operation.

Parameters
dataInput data to bucketize
buckets1-D of sorted unique boundaries for buckets
output_typeOutput tensor type, "i64" or "i32", defaults to i64
with_right_boundindicates whether bucket includes the right or left edge of interval. default true = includes right edge
nameOptional name for output node.
Returns
Bucketize node

◆ cum_sum()

Node ngraph.opset3.ops.cum_sum ( NodeInput  arg,
NodeInput  axis,
bool   exclusive = False,
bool   reverse = False,
Optional[str]   name = None 
)

Construct a cumulative summation operation.

Parameters
argThe tensor to be summed.
axiszero dimension tensor specifying axis position along which sum will be performed.
exclusiveif set to true, the top element is not included
reverseif set to true, will perform the sums in reverse direction
Returns
New node performing the operation

◆ embedding_bag_offsets_sum()

Node ngraph.opset3.ops.embedding_bag_offsets_sum ( Node  emb_table,
NodeInput  indices,
NodeInput  offsets,
Optional[NodeInput]   default_index = None,
Optional[NodeInput]   per_sample_weights = None,
Optional[str]   name = None 
)

Return a node which performs sums of bags of embeddings without the intermediate embeddings.

Parameters
emb_tableTensor containing the embedding lookup table.
indicesTensor with indices.
offsetsTensor containing the starting index positions of each bag in indices.
per_sample_weightsTensor with weights for each sample.
default_indexScalar containing default index in embedding table to fill empty bags.
nameOptional name for output node.
Returns
The new node which performs EmbeddingBagOffsetsSum

◆ embedding_bag_packed_sum()

Node ngraph.opset3.ops.embedding_bag_packed_sum ( NodeInput  emb_table,
NodeInput  indices,
Optional[NodeInput]   per_sample_weights = None,
Optional[str]   name = None 
)

Return an EmbeddingBagPackedSum node.

EmbeddingSegmentsSum constructs an output tensor by replacing every index in a given input tensor with a row (from the weights matrix) at that index

Parameters
emb_tableTensor containing the embedding lookup table.
indicesTensor with indices.
per_sample_weightsWeights to be multiplied with embedding table.
nameOptional name for output node.
Returns
EmbeddingBagPackedSum node

◆ embedding_segments_sum()

Node ngraph.opset3.ops.embedding_segments_sum ( Node  emb_table,
NodeInput  indices,
NodeInput  segment_ids,
Optional[NodeInput]   num_segments = None,
Optional[NodeInput]   default_index = None,
Optional[NodeInput]   per_sample_weights = None,
Optional[str]   name = None 
)

Return an EmbeddingSegmentsSum node.

EmbeddingSegmentsSum constructs an output tensor by replacing every index in a given input tensor with a row (from the weights matrix) at that index

Parameters
emb_tableTensor containing the embedding lookup table.
indicesTensor with indices.
segment_idsTensor with indices into the output Tensor
num_segmentsTensor with number of segments.
default_indexScalar containing default index in embedding table to fill empty bags.
per_sample_weightsWeights to be multiplied with embedding table.
nameOptional name for output node.
Returns
EmbeddingSegmentsSum node

◆ extract_image_patches()

Node ngraph.opset3.ops.extract_image_patches ( NodeInput  image,
TensorShape  sizes,
List[int]  strides,
TensorShape  rates,
str  auto_pad,
Optional[str]   name = None 
)

Return a node which produces the ExtractImagePatches operation.

Parameters
image4-D Input data to extract image patches.
sizesPatch size in the format of [size_rows, size_cols].
stridesPatch movement stride in the format of [stride_rows, stride_cols]
ratesElement seleciton rate for creating a patch.
auto_padPadding type.
nameOptional name for output node.
Returns
ExtractImagePatches node

◆ gru_cell()

Node ngraph.opset3.ops.gru_cell ( NodeInput  X,
NodeInput  initial_hidden_state,
NodeInput  W,
NodeInput  R,
NodeInput  B,
int  hidden_size,
List[str]   activations = None,
List[float]   activations_alpha = None,
List[float]   activations_beta = None,
float   clip = 0.0,
bool   linear_before_reset = False,
Optional[str]   name = None 
)

Perform GRUCell operation on the tensor from input node.

GRUCell represents a single GRU Cell that computes the output using the formula described in the paper: https://arxiv.org/abs/1406.1078

Note this class represents only single cell and not whole layer.

Parameters
XThe input tensor with shape: [batch_size, input_size].
initial_hidden_stateThe hidden state tensor at current time step with shape: [batch_size, hidden_size].
WThe weights for matrix multiplication, gate order: zrh. Shape: [3*hidden_size, input_size].
RThe recurrence weights for matrix multiplication. Shape: [3*hidden_size, hidden_size].
BThe sum of biases (weight and recurrence). For linear_before_reset set True the shape is [4*hidden_size]. Otherwise the shape is [3*hidden_size].
hidden_sizeThe number of hidden units for recurrent cell. Specifies hidden state size.
activationsThe vector of activation functions used inside recurrent cell.
activation_alphaThe vector of alpha parameters for activation functions in order respective to activation list.
activation_betaThe vector of beta parameters for activation functions in order respective to activation list.
clipThe value defining clipping range [-clip, clip] on input of activation functions.
linear_before_resetFlag denotes if the layer behaves according to the modification of GRUCell described in the formula in the ONNX documentation.
nameOptional output node name.
Returns
The new node performing a GRUCell operation on tensor from input node.

◆ non_max_suppression()

Node ngraph.opset3.ops.non_max_suppression ( NodeInput  boxes,
NodeInput  scores,
Optional[NodeInput]   max_output_boxes_per_class = None,
Optional[NodeInput]   iou_threshold = None,
Optional[NodeInput]   score_threshold = None,
str   box_encoding = "corner",
bool   sort_result_descending = True,
str   output_type = "i64",
Optional[str]   name = None 
)

Return a node which performs NonMaxSuppression.

Parameters
boxesTensor with box coordinates.
scoresTensor with box scores.
max_output_boxes_per_classTensor Specifying maximum number of boxes to be selected per class.
iou_thresholdTensor specifying intersection over union threshold
score_thresholdTensor specifying minimum score to consider box for the processing.
box_encodingFormat of boxes data encoding.
sort_result_descendingFlag that specifies whenever it is necessary to sort selected boxes across batches or not.
output_typeOutput element type.
Returns
The new node which performs NonMaxSuppression

◆ non_zero()

Node ngraph.opset3.ops.non_zero ( NodeInput  data,
str   output_type = "i64",
Optional[str]   name = None 
)

Return the indices of the elements that are non-zero.

Parameters
dataInput data.
output_typeOutput tensor type.
Returns
The new node which performs NonZero

◆ read_value()

Node ngraph.opset3.ops.read_value ( NodeInput  init_value,
str  variable_id,
Optional[str]   name = None 
)

Return a node which produces the Assign operation.

Parameters
init_valueNode producing a value to be returned instead of an unassigned variable.
variable_idId of a variable to be read.
nameOptional name for output node.
Returns
ReadValue node

◆ rnn_cell()

Node ngraph.opset3.ops.rnn_cell ( NodeInput  X,
NodeInput  initial_hidden_state,
NodeInput  W,
NodeInput  R,
NodeInput  B,
int  hidden_size,
List[str]  activations,
List[float]  activations_alpha,
List[float]  activations_beta,
float   clip = 0.0,
Optional[str]   name = None 
)

Perform RNNCell operation on tensor from input node.

It follows notation and equations defined as in ONNX standard: https://github.com/onnx/onnx/blob/master/docs/Operators.md#RNN

Note this class represents only single cell and not whole RNN layer.

Parameters
XThe input tensor with shape: [batch_size, input_size].
initial_hidden_stateThe hidden state tensor at current time step with shape: [batch_size, hidden_size].
WThe weight tensor with shape: [hidden_size, input_size].
RThe recurrence weight tensor with shape: [hidden_size, hidden_size].
BThe bias tensor for input gate with shape: [2*hidden_size].
hidden_sizeThe number of hidden units for recurrent cell. Specifies hidden state size.
activationsThe vector of activation functions used inside recurrent cell.
activation_alphaThe vector of alpha parameters for activation functions in order respective to activation list.
activation_betaThe vector of beta parameters for activation functions in order respective to activation list.
clipThe value defining clipping range [-clip, clip] on input of activation functions.
nameOptional output node name.
Returns
The new node performing a RNNCell operation on tensor from input node.

◆ roi_align()

Node ngraph.opset3.ops.roi_align ( NodeInput  data,
NodeInput  rois,
NodeInput  batch_indices,
int  pooled_h,
int  pooled_w,
int  sampling_ratio,
float  spatial_scale,
str  mode,
Optional[str]   name = None 
)

Return a node which performs ROIAlign.

Parameters
dataInput data.
roisRoIs (Regions of Interest) to pool over.
batch_indicesTensor with each element denoting the index of the corresponding image in the batch.
pooled_hHeight of the ROI output feature map.
pooled_wWidth of the ROI output feature map.
sampling_ratioNumber of bins over height and width to use to calculate each output feature map element.
spatial_scaleMultiplicative spatial scale factor to translate ROI coordinates.
modeMethod to perform pooling to produce output feature map elements.
Returns
The new node which performs ROIAlign

◆ scatter_elements_update()

Node ngraph.opset3.ops.scatter_elements_update ( NodeInput  data,
NodeInput  indices,
NodeInput  updates,
NodeInput  axis,
Optional[str]   name = None 
)

Return a node which produces a ScatterElementsUpdate operation.

ScatterElementsUpdate creates a copy of the first input tensor with updated elements specified with second and third input tensors.

For each entry in `updates`, the target index in `data` is obtained by combining
the corresponding entry in `indices` with the index of the entry itself: the
index-value for dimension equal to `axis` is obtained from the value of the
corresponding entry in `indices` and the index-value for dimension not equal
to `axis` is obtained from the index of the entry itself.

@param data:    The input tensor to be updated.
@param indices: The tensor with indexes which will be updated.
@param updates: The tensor with update values.
@param axis:    The axis for scatter.
@return ScatterElementsUpdate node

◆ scatter_update()

Node ngraph.opset3.ops.scatter_update ( Node  data,
NodeInput  indices,
NodeInput  updates,
NodeInput  axis,
Optional[str]   name = None 
)

Return a node which produces a ScatterUpdate operation.

ScatterUpdate sets new values to slices from data addressed by indices.

Parameters
dataThe input tensor to be updated.
indicesThe tensor with indexes which will be updated.
updatesThe tensor with update values.
axisThe axis at which elements will be updated.
Returns
ScatterUpdate node

◆ shape_of()

Node ngraph.opset3.ops.shape_of ( NodeInput  data,
str   output_type = "i64",
Optional[str]   name = None 
)

Return a node which produces a tensor containing the shape of its input data.

Parameters
dataThe tensor containing the input data. :para output_type: Output element type.
Returns
ShapeOf node

◆ shuffle_channels()

Node ngraph.opset3.ops.shuffle_channels ( Node  data,
int  axis,
int  groups,
Optional[str]   name = None 
)

Perform permutation on data in the channel dimension of the input tensor.

The operation is the equivalent with the following transformation of the input tensor data of shape [N, C, H, W]:

data_reshaped = reshape(data, [N, group, C / group, H * W])

data_trnasposed = transpose(data_reshaped, [0, 2, 1, 3])

output = reshape(data_trnasposed, [N, C, H, W])

For example:

Inputs: tensor of shape [1, 6, 2, 2]
data = [[[[ 0., 1.], [ 2., 3.]],
[[ 4., 5.], [ 6., 7.]],
[[ 8., 9.], [10., 11.]],
[[12., 13.], [14., 15.]],
[[16., 17.], [18., 19.]],
[[20., 21.], [22., 23.]]]]
axis = 1
groups = 3
Output: tensor of shape [1, 6, 2, 2]
output = [[[[ 0., 1.], [ 2., 3.]],
[[ 8., 9.], [10., 11.]],
[[16., 17.], [18., 19.]],
[[ 4., 5.], [ 6., 7.]],
[[12., 13.], [14., 15.]],
[[20., 21.], [22., 23.]]]]
@param data: The node with input tensor.
@param axis: Channel dimension index in the data tensor.
             A negative value means that the index should be calculated
             from the back of the input data shape.
@param group: The channel dimension specified by the axis parameter
             should be split into this number of groups.
@param name: Optional output node name.
@return The new node performing a permutation on data in the channel dimension
         of the input tensor.

◆ topk()

Node ngraph.opset3.ops.topk ( NodeInput  data,
NodeInput  k,
int  axis,
str  mode,
str  sort,
str   index_element_type = "i32",
Optional[str]   name = None 
)

Return a node which performs TopK.

Parameters
dataInput data.
kK.
axisTopK Axis.
modeCompute TopK largest ('max') or smallest ('min')
sortOrder of output elements (sort by: 'none', 'index' or 'value')
index_element_typeType of output tensor with indices.
Returns
The new node which performs TopK (both indices and values)