shape_image.h#
Shape-inference functions for ONNX operators in the image family.
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Defined as empty because onnx-light does not require explicit
__declspec(dllexport)or__attribute__((visibility("default")))annotations — visibility is controlled at the shared-library level. The macro is provided so that vendored ONNX headers that decorate their declarations withONNX_APIcompile without modification.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.-
namespace onnx_optim
-
namespace shapes
-
namespace image#
Functions
-
void ComputeShapeImageDecoder(ShapesContext &ctx, const NodeProto &node, const char *a)#
Computes the output :cpp:class:
OptimTensorof anImageDecodernode and stores it inctx.ImageDecoder(since opset 20 in theai.onnxdomain) takes a 1-Dtensor(uint8)carrying an encoded image bytestream and returns the decoded image as a 3-Dtensor(uint8)laid out as(Height, Width, Channels). The spatial extent of the decoded image only becomes known at runtime, so the output’sHandWdimensions are produced as symbolic dims; the channel count is derived from thepixel_formatattribute ("Grayscale"⇒ 1,"RGB"/"BGR"⇒ 3, defaulting to"RGB"when omitted).- Parameters:
ctx – In/out context. Must already contain an :cpp:class:
OptimTensorentry fora; on return it also contains an entry fornode.output(0).node – The
ImageDecoderNodeProtowhose output should be described.node.op_type()must be"ImageDecoder"andnodemust declare at least one output.a – Name of the input value to read from
ctx.
- Throws:
-
void ComputeShapeImageDecoder(ShapesContext &ctx, const NodeProto &node, const char *a)#
-
namespace image#
-
namespace shapes
-
namespace onnx_optim