shape_traditionalml.h#
Shape-inference functions for ONNX operators in the ai.onnx.ml (traditional machine-learning) family.
-
namespace ONNX_LIGHT_NAMESPACE
-
namespace onnx_optim
-
namespace shapes
-
namespace traditionalml#
Functions
-
void ComputeShapeBinarizer(ShapesContext &ctx, const NodeProto &node, const char *x)#
Computes the output :cpp:class:
OptimTensorof aBinarizernode and stores it inctx.Binarizer(ai.onnx.ml) is an element-wise operator: the output tensor has the exact same shape and element type as the input — only the values change (each element becomes1if it is strictly greater than thethresholdattribute,0otherwise).- Parameters:
ctx – In/out context. Must already contain an entry for
x; on return it also contains an entry fornode.output(0).node – The
BinarizerNodeProtowhose output should be described.node.op_type()must be"Binarizer"andnodemust declare at least one output.x – Name of the input value to read from
ctx. Must be present inctx.
- Throws:
-
void ComputeShapeLabelEncoder(ShapesContext &ctx, const NodeProto &node, const char *x)#
Computes the output :cpp:class:
OptimTensorof aLabelEncodernode and stores it inctx.LabelEncoder(ai.onnx.ml) is a one-to-one mapping from input keys to output values, so the output shape always matches the input shape. The output dtype is determined by which of thevalues_*attributes is set:values_tensor— dtype is the tensor’sdata_type;values_strings— dtype isstring;values_int64s— dtype isint64;values_floats— dtype isfloat.
Exactly one of these attributes must be set; an error is raised otherwise.
- Parameters:
ctx – In/out context. Must already contain an entry for
x; on return it also contains an entry fornode.output(0).node – The
LabelEncoderNodeProtowhose output should be described.node.op_type()must be"LabelEncoder"andnodemust declare at least one output.x – Name of the input value to read from
ctx. Must be present inctx.
- Throws:
Variables
-
constexpr const char *kOnnxMlDomain = "ai.onnx.ml"#
Canonical domain string for the
ai.onnx.mloperator set.
-
void ComputeShapeBinarizer(ShapesContext &ctx, const NodeProto &node, const char *x)#
-
namespace traditionalml#
-
namespace shapes
-
namespace onnx_optim