.. _op_ai_onnx_Less: Less ==== - **Domain**: ``ai.onnx`` - **Since version**: 13 Returns the tensor resulted from performing the ``Less`` logical operation elementwise on the input tensors ``A`` and ``B`` (with Numpy-style broadcasting support). **Inputs** - **A** (*T*): First input operand for the logical operator. - **B** (*T*): Second input operand for the logical operator. **Outputs** - **C** (*T1*): Result tensor. **Type Constraints** - **T**: Constrain input types to all numeric tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8). - **T1**: Constrain output to boolean tensor. Allowed types: tensor(bool). Examples -------- **test_cc_less** .. code-block:: text Inputs: x: shape=(2, 2), dtype=float32 [[1., 2.], [3., 4.]] y: shape=(2, 2), dtype=float32 [[2., 2.], [2., 2.]] Outputs: z: shape=(2, 2), dtype=bool [[ True, False], [False, False]] **test_cc_less_bcast** .. code-block:: text Inputs: x: shape=(2, 2), dtype=float32 [[1., 2.], [3., 4.]] y: shape=(), dtype=float32 2.5 Outputs: z: shape=(2, 2), dtype=bool [[ True, True], [False, False]] **test_less** .. code-block:: text Inputs: x: shape=(3, 4, 5), dtype=float32 [[[-0.24912022, 0.37703994, -0.69417447, -0.7060292 , 0.20510858], [-0.6286968 , 1.6711484 , 0.33107895, 0.7037558 , -1.3299477 ], [ 1.2570701 , 1.9146868 , -0.6062891 , -1.0759572 , -0.16256061], [ 0.2966216 , -0.32503194, 0.27875352, -0.66562593, 0.01234083]], [[-0.20715022, 0.14588691, 1.1557806 , 0.46587473, 0.97787076], [-1.0761734 , -0.8160329 , -0.7835996 , -0.23407106, 1.9457138 ], [ 1.0166521 , -1.4913279 , -0.6863505 , -0.40249848, -1.3852327 ], [-0.77970237, 0.8188312 , -0.11476051, -0.29980806, 0.64011383]], [[-0.58414567, -1.0774288 , -0.68119806, 0.7641559 , -2.0380206 ], [-0.01588069, 1.8616133 , -1.0863703 , 0.31693026, -0.6249668 ], [-1.7837567 , -1.1630548 , 0.22905143, -0.25897345, 0.5301326 ], [ 0.44164625, 0.07234928, -0.8231903 , 0.33295313, 0.59297967]]] y: shape=(3, 4, 5), dtype=float32 [[[-1.313993 , -0.9773617 , -0.6343613 , -0.979214 , -0.58685726], [ 1.6898878 , 0.08713032, 1.1718034 , 0.79937506, 0.02316316], [ 0.29876754, 0.3574321 , 1.1932331 , -0.9904888 , 0.60881287], [-0.48373404, 0.70216364, -0.8474465 , -1.2743044 , 0.29819134]], [[-0.4808629 , 0.29299355, -0.61132276, 0.3887899 , -1.2674389 ], [-0.60134256, -0.5235882 , 0.97903776, -0.41479465, 0.15080978], [ 1.9587631 , -1.2112936 , -0.30354005, 0.14342186, -0.8019956 ], [ 2.3820956 , 0.72104615, -0.44501275, -1.3686862 , -0.5832208 ]], [[ 0.7293726 , -1.5513726 , 0.8104244 , 1.7539967 , -0.0733771 ], [ 1.4704529 , -0.6496508 , -0.20207614, -0.43526402, -1.2906929 ], [ 1.0649142 , 0.89014375, 0.86430603, -1.833441 , 0.4498562 ], [-1.6465589 , -2.0779915 , -0.7255597 , -1.012863 , 0.95887685]]] Outputs: less: shape=(3, 4, 5), dtype=bool [[[False, False, True, False, False], [ True, False, True, True, True], [False, False, True, True, True], [False, True, False, False, True]], [[False, True, False, False, False], [ True, True, True, False, False], [ True, True, True, True, True], [ True, False, False, False, False]], [[ True, False, True, True, True], [ True, False, True, False, False], [ True, True, True, False, False], [False, False, True, False, True]]] **test_less_bcast** .. code-block:: text Inputs: x: shape=(3, 4, 5), dtype=float32 [[[-0.77932763, -0.11304837, -0.02405588, -0.74120575, 0.8054617 ], [-0.7910769 , 0.27689603, 1.9664423 , 0.8854545 , -1.534002 ], [ 0.92959636, 0.5410489 , 0.75333405, -0.2559339 , 0.813136 ], [-0.19769451, 0.7592801 , -0.773745 , -0.20088923, 0.9104622 ]], [[ 1.7654598 , -1.5343306 , -0.2801714 , -0.26017332, 1.7559413 ], [ 1.4949077 , 0.36709183, -0.2965113 , 0.6934157 , 0.33218938], [-0.80441034, 0.50218654, 0.11497802, -0.20262195, -0.08662814], [-0.24888717, 0.40791112, -0.33651662, 0.26782736, -0.6243853 ]], [[ 0.17729989, 0.786931 , 0.15775031, -0.5427288 , 1.1266938 ], [-0.6303296 , -1.9371543 , -0.79998 , -0.32684922, 0.5279692 ], [ 0.15060616, -0.31763977, -0.4506991 , -0.62456864, -1.5034933 ], [-1.2187058 , 0.899553 , 1.2907162 , -0.59581614, 1.2079502 ]]] y: shape=(5,), dtype=float32 [ 0.85281533, -2.0860636 , 0.6411558 , -0.8953869 , 0.9196889 ] Outputs: less: shape=(3, 4, 5), dtype=bool [[[ True, False, True, False, True], [ True, False, False, False, True], [False, False, False, False, True], [ True, False, True, False, True]], [[False, False, True, False, False], [False, False, True, False, True], [ True, False, True, False, True], [ True, False, True, False, True]], [[ True, False, True, False, False], [ True, False, True, False, True], [ True, False, True, False, True], [ True, False, False, False, False]]] Differences with previous version (9) ------------------------------------- **SchemaDiff**: ``Less`` (domain ``'ai.onnx'``) * old version: 9 * new version: 13 * breaking: no **Type constraints:** * changed 'T': added types: ['tensor(bfloat16)'] Version History --------------- - :doc:`Version 9 ` - :doc:`Version 7 ` - :doc:`Version 1 `