Data Structures | Enumerations | Functions
ngraph::op Namespace Reference

Ops used in graph-building. More...

Data Structures

struct  AutoBroadcastSpec
 Implicit broadcast specification. More...
 
struct  BroadcastModeSpec
 Implicit broadcast specification. More...
 
struct  DetectionOutputAttrs
 
class  Op
 Root of all actual ops. More...
 
struct  PriorBoxAttrs
 
struct  PriorBoxClusteredAttrs
 
struct  ProposalAttrs
 

Enumerations

enum  LSTMWeightsFormat {
  FICO, ICOF, IFCO, IFOC,
  IOFC
}
 
enum  PadMode { CONSTANT = 0, EDGE, REFLECT, SYMMETRIC }
 Modes for the Pad operator.
 
enum  PadType {
  EXPLICIT = 0, SAME_LOWER, SAME_UPPER, VALID,
  AUTO = SAME_UPPER, NOTSET = EXPLICIT
}
 Padding Type used for Convolution and Pooling More...
 
enum  RoundingType { FLOOR = 0, CEIL = 1 }
 Rounding Type used for Pooling operators.
 
enum  AutoBroadcastType { NONE = 0, EXPLICIT = NONE, NUMPY, PDPD }
 Specifies the algorithm to use for implicit broadcasting of a tensor to align with another tensor. More...
 
enum  BroadcastType {
  NONE, EXPLICIT = NONE, NUMPY, PDPD,
  BIDIRECTIONAL
}
 BroadcastType specifies rules used for mapping of input tensor axes to output shape axes. More...
 
enum  EpsMode { ADD, MAX }
 Specifies how eps is combined with L2 value.
 
enum  TopKSortType { NONE, SORT_INDICES, SORT_VALUES }
 
enum  TopKMode { MAX, MIN }
 
enum  RecurrentSequenceDirection { FORWARD, REVERSE, BIDIRECTIONAL }
 This class defines possible recurrent sequence directions.
 

Functions

NGRAPH_API std::ostream & operator<< (std::ostream &s, const PadMode &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const PadType &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const RoundingType &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const AutoBroadcastType &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const BroadcastType &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const EpsMode &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const TopKSortType &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const TopKMode &type)
 
NGRAPH_API std::ostream & operator<< (std::ostream &s, const RecurrentSequenceDirection &direction)
 
NGRAPH_API bool is_unary_elementwise_arithmetic (const ngraph::Node *node)
 
NGRAPH_API bool is_binary_elementwise_arithmetic (const ngraph::Node *node)
 
NGRAPH_API bool is_binary_elementwise_comparison (const ngraph::Node *node)
 
NGRAPH_API bool is_binary_elementwise_logical (const ngraph::Node *node)
 
NGRAPH_API bool supports_auto_broadcast (const ngraph::Node *node)
 
NGRAPH_API bool supports_decompose (const ngraph::Node *node)
 
NGRAPH_API bool is_op (const ngraph::Node *node)
 
NGRAPH_API bool is_parameter (const ngraph::Node *node)
 
NGRAPH_API bool is_output (const ngraph::Node *node)
 
NGRAPH_API bool is_constant (const ngraph::Node *node)
 
NGRAPH_API bool is_commutative (const ngraph::Node *node)
 
NGRAPH_API bool is_unary_elementwise_arithmetic (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_binary_elementwise_arithmetic (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_binary_elementwise_comparison (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_binary_elementwise_logical (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool supports_auto_broadcast (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool supports_decompose (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_op (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_parameter (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_output (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_constant (const std::shared_ptr< ngraph::Node > &node)
 
NGRAPH_API bool is_commutative (const std::shared_ptr< ngraph::Node > &node)
 
ONNX_IMPORTER_API bool is_null (const ngraph::Node *node)
 
ONNX_IMPORTER_API bool is_null (const std::shared_ptr< ngraph::Node > &node)
 
ONNX_IMPORTER_API bool is_null (const Output< ngraph::Node > &output)
 

Detailed Description

Ops used in graph-building.

Enumeration Type Documentation

◆ AutoBroadcastType

Specifies the algorithm to use for implicit broadcasting of a tensor to align with another tensor.

NONE - No implicit broadcasting of tensor NUMPY - Numpy-style implicit broadcasting (https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) Right-align dimensions of the two tensors, with missing dimensions treated as size 1 dimensions. After alignment, for each dimension, their sizes should either match or one of them should be of size 1. Size 1 dimension will be implicitly broadcast to match the other size.

E.g., A: Shape(2, 1, 6) B: Shape( 3, 1) Result: Shape(2, 3, 6)

 A: Shape(2, 1, 6)
 B: Shape(   3, 1)

Result: Shape(2, 3, 6) PDPD - PaddlePaddle-style implicit broadcasting (https://github.com/PaddlePaddle/Paddle/blob/release/1.5/paddle/ fluid/operators/elementwise/elementwise_op.h#L126) Broadcast B to match the shape of A, where axis is the start dimension index to align B with A. If axis is -1 (default), i axis = rank(A) - rank(B). The trailing dimensions of size 1 for B will be ignored.

E.g., A: Shape(2, 3, 4, 5) B: Shape( 3, 4 ) with axis =1 Result: Shape(2, 3, 4, 5)

 A: Shape(2, 3, 4, 5)
 B: Shape(   3, 1   ) with axis = 1

Result: Shape(2, 3, 4, 5)

TODO: Add more implicit broadcast modes used by frameworks

◆ BroadcastType

BroadcastType specifies rules used for mapping of input tensor axes to output shape axes.

Note
Broadcasting rules are different for Broadcast op and for element-wise ops. AutoBroadcastType::NUMPY is equivalent of BroadcastType::BIDIRECTIONAL according to spec.

EXPLICIT - Mapping of the input data shape to output shape based on axes_mapping input. NUMPY - Numpy broadcasting rules, aligned with ONNX Broadcasting. (https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md) PDPD - PaddlePaddle-style implicit broadcasting. For more informaction see AutoBroadcastType documentation. BIDIRECTIONAL - The broadcast rule is similar to numpy.array(input) * numpy.ones(target_shape). Dimensions are right alignment.

◆ PadType

enum ngraph::op::PadType
strong

Padding Type used for Convolution and Pooling

Follows ONNX padding type definitions EXPLICIT - Pad dimensions are explicity specified SAME_LOWER - Pad dimensions computed to match input shape Ceil(num_dims/2) at the beginning and Floor(num_dims/2) at the end SAME_UPPER - Pad dimensions computed to match input shape Floor(num_dims/2) at the beginning and Ceil(num_dims/2) at the end VALID - No padding