Skip to content

Commit 502f045

Browse files
committed
Add limit tests for softmax
1 parent c122421 commit 502f045

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

backends/nxp/backend/ir/converter/node_converters/ops_converters/softmax_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _is_supported_on_target(
6363
"""New flow: Hardware constraints for the new flow:
6464
1. Input and Output must be INT8/UINT8
6565
2. Channels <= 2040
66-
3. Total spatial size (H*W) <= 4096
66+
3. Total spatial size <= 4096
6767
4. Total size (channels * spatial_size) <= 524288
6868
"""
6969
# Constraint 1: Input and Output must be INT8/UINT8.

backends/nxp/tests/ir/converter/node_converter/test_softmax_converter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ def test__basic_nsys_inference(self, mocker, input_shape, dim):
248248
pytest.param((4096, 8), -1, id="2D_spatial_size_limit"),
249249
pytest.param((2040,), -1, id="1D_channels_limit"),
250250
pytest.param((4096, 128), -1, id="2D_total_size_limit"),
251-
pytest.param((1, 64, 64, 8), -1, id="4D_spatial_size_limit"),
251+
pytest.param((1, 64, 64, 8), -1, id="4D_spatial_size_limit_1x64x64"),
252+
pytest.param((2, 32, 64, 8), -1, id="4D_spatial_size_limit_2x32x64"),
252253
],
253254
)
254255
def test__limits(self, input_shape, dim, mocker):
@@ -266,7 +267,8 @@ def test__limits(self, input_shape, dim, mocker):
266267
pytest.param((4097, 8), -1, id="2D_spatial_size_exceeded"),
267268
pytest.param((2048,), -1, id="1D_channels_exceeded"),
268269
pytest.param((4096, 129), -1, id="2D_total_size_exceeded"),
269-
pytest.param((1, 64, 65, 8), -1, id="4D_spatial_size_exceeded"),
270+
pytest.param((1, 64, 65, 8), -1, id="4D_spatial_size_exceeded_1x64x65"),
271+
pytest.param((2, 32, 65, 8), -1, id="4D_spatial_size_exceeded_2x32x65"),
270272
],
271273
)
272274
def test__limits_exceeded(self, input_shape, dim):

0 commit comments

Comments
 (0)