.. _op_ai_onnx_RandomNormalLike: RandomNormalLike ================ - **Domain**: ``ai.onnx`` - **Since version**: 22 Generate a tensor with random values drawn from a normal distribution. The shape of the output tensor is copied from the shape of the input tensor, and the parameters of the normal distribution are specified by ``mean`` and ``scale``. The data type is specified by the 'dtype' argument, or copied from the input tensor if not provided. The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the TensorProto message, and be valid as an output type. **Inputs** - **input** (*T1*): Input tensor to copy shape and optionally type information from. **Outputs** - **output** (*T2*): Output tensor of random values drawn from normal distribution **Attributes** - **dtype** (*int*): (Optional) The data type for the elements of the output tensor, if not specified, we will use the data type of the input tensor. - **mean** (*float*): The mean of the normal distribution. - **scale** (*float*): The standard deviation of the normal distribution. - **seed** (*float*): (Optional) Seed to the random generator, if not specified we will auto generate one. **Type Constraints** - **T1**: Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type. Allowed types: tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8). - **T2**: Constrain output types to float tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16). Examples -------- **test_cc_randomnormallike** .. code-block:: text Node: RandomNormalLike(x) -> (y) .. code-block:: text Inputs: x: shape=(2, 3), dtype=float32 [[0., 0., 0.], [0., 0., 0.]] Outputs: y: shape=(2, 3), dtype=float32 [[ 0.04646347, 1.3829458 , 0.1371488 ], [-1.691909 , 0.6007101 , 0.24345492]] **test_cc_randomnormallike_double** .. code-block:: text Node: RandomNormalLike(x) -> (y) Attributes: dtype = 11 .. code-block:: text Inputs: x: shape=(2, 3), dtype=float32 [[0., 0., 0.], [0., 0., 0.]] Outputs: y: shape=(2, 3), dtype=float64 [[ 0.04646347, 1.38294577, 0.1371488 ], [-1.69190901, 0.60071012, 0.24345492]] **test_cc_randomnormallike_seeded** .. code-block:: text Node: RandomNormalLike(x) -> (y) Attributes: mean = 1.0 scale = 0.5 seed = 7.0 .. code-block:: text Inputs: x: shape=(2, 3), dtype=float32 [[0., 0., 0.], [0., 0., 0.]] Outputs: y: shape=(2, 3), dtype=float32 [[0.49952292, 1.6667702 , 1.259431 ], [0.5603149 , 0.8277756 , 1.3630688 ]] Differences with previous version (1) ------------------------------------- **SchemaDiff**: ``RandomNormalLike`` (domain ``'ai.onnx'``) * old version: 1 * new version: 22 * breaking: no **Type constraints:** * changed 'T1': added types: ['tensor(bfloat16)'] * changed 'T2': added types: ['tensor(bfloat16)'] Version History --------------- - :doc:`Version 1 `