onnx_light.onnx.tools#
Public helpers that complement onnx_light.onnx.
- onnx_light.onnx.tools.make_random_input(elem_type: int, shape: list[int], seed: int) ndarray#
Creates a random NumPy array for an ONNX tensor input.
Uses the same deterministic pseudo-random generators as the onnx-light runtime (
onnx_light.onnx_lib.backend.random).- Parameters:
elem_type –
TensorProtodata-type integer (e.g.TensorProto.FLOAT).shape – Concrete non-negative integer dimensions.
seed – Integer seed forwarded to the random generator.
- Returns:
A
numpy.ndarrayof the appropriate dtype and shape.- Raises:
NotImplementedError – For unsupported element types (e.g. STRING).