.. _op_ai_onnx_Mean: Mean ==== - **Domain**: ``ai.onnx`` - **Since version**: 13 Element-wise mean of each of the input tensors (with Numpy-style broadcasting support). All inputs and outputs must have the same data type. This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `the doc `_. **Inputs** - **data_0** (*T*): List of tensors for mean. **Outputs** - **mean** (*T*): Output tensor. **Type Constraints** - **T**: Constrain input and output types to float tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16). Examples -------- **test_cc_mean_bcast** .. code-block:: text Node: Mean(data_0, data_1) -> (result) .. code-block:: text Inputs: data_0: shape=(2, 2), dtype=float32 [[1., 2.], [3., 4.]] data_1: shape=(), dtype=float32 10. Outputs: result: shape=(2, 2), dtype=float32 [[5.5, 6. ], [6.5, 7. ]] **test_mean_example** .. code-block:: text Node: Mean(data_0, data_1, data_2) -> (result) .. code-block:: text Inputs: data_0: shape=(3,), dtype=float32 [3., 0., 2.] data_1: shape=(3,), dtype=float32 [1., 3., 4.] data_2: shape=(3,), dtype=float32 [2., 6., 6.] Outputs: result: shape=(3,), dtype=float32 [2., 3., 4.] **test_mean_one_input** .. code-block:: text Node: Mean(data_0) -> (result) .. code-block:: text Inputs: data_0: shape=(3,), dtype=float32 [3., 0., 2.] Outputs: result: shape=(3,), dtype=float32 [3., 0., 2.] **test_mean_two_inputs** .. code-block:: text Node: Mean(data_0, data_1) -> (result) .. code-block:: text Inputs: data_0: shape=(3,), dtype=float32 [3., 0., 2.] data_1: shape=(3,), dtype=float32 [1., 3., 4.] Outputs: result: shape=(3,), dtype=float32 [2. , 1.5, 3. ] Differences with previous version (8) ------------------------------------- **SchemaDiff**: ``Mean`` (domain ``'ai.onnx'``) * old version: 8 * new version: 13 * breaking: no **Type constraints:** * changed 'T': added types: ['tensor(bfloat16)'] Version History --------------- - :doc:`Version 8 ` - :doc:`Version 6 ` - :doc:`Version 1 `