Class OutshapePureByInshapeOpr

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class mgb::cg::mixin::OutshapePureByInshapeOpr : public mgb::cg::OperatorNodeMixinBase

mixin class for implementing operators whose output shapes are completely determined by input shapes

Subclassed by mgb::cg::mixin::IOSameShapeOperatorNode

Protected Functions

void mixin_set_nr_managed_outputs(OperatorNodeBase &opr, size_t nr)

By default, all output vars would be managed by OutshapePureByInshapeOprBase; call this function to set the number of output vars that should be managed by this helper (they would be the first vars of all output vars).

void mixin_init_output_static_infer_desc(OperatorNodeBase &opr)
void get_output_var_shape(const TensorShapeArray &inp_shape, TensorShapeArray &out_shape) const = 0

get output shapes from input shapes

  • inp_shape: current input shape; each element matches an input var

  • out_shape: output shape; storage already allocated, and each element matches an output var