Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -45,6 +47,7 @@ def test_abs_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(AbsModel(), (torch.randn(3, 4, 5),), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_abs_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
2 changes: 2 additions & 0 deletions backends/test/suite/operators/test_amax.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# pyre-unsafe

import unittest
from typing import List, Optional, Tuple, Union

import torch
Expand Down Expand Up @@ -201,6 +202,7 @@ def test_amax_shapes(self, flow: TestFlow) -> None:
flow,
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_amax_edge_cases(self, flow: TestFlow) -> None:
x = torch.tensor([[1.0, float("inf"), 3.0], [4.0, 5.0, float("inf")]])
self._test_op(
Expand Down
2 changes: 2 additions & 0 deletions backends/test/suite/operators/test_amin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# pyre-unsafe

import unittest
from typing import List, Optional, Tuple, Union

import torch
Expand Down Expand Up @@ -203,6 +204,7 @@ def test_amin_shapes(self, flow: TestFlow) -> None:
flow,
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_amin_edge_cases(self, flow: TestFlow) -> None:
x = torch.tensor([[1.0, float("-inf"), 3.0], [4.0, 5.0, float("-inf")]])
self._test_op(
Expand Down
2 changes: 2 additions & 0 deletions backends/test/suite/operators/test_argmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# pyre-unsafe

import unittest
from typing import Optional

import torch
Expand Down Expand Up @@ -143,6 +144,7 @@ def test_argmax_shapes(self, flow: TestFlow) -> None:
flow,
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_argmax_edge_cases(self, flow: TestFlow) -> None:
x = torch.tensor([[1.0, float("inf"), 3.0], [4.0, 5.0, float("inf")]])
self._test_op(
Expand Down
2 changes: 2 additions & 0 deletions backends/test/suite/operators/test_argmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# pyre-unsafe

import unittest
from typing import Optional

import torch
Expand Down Expand Up @@ -143,6 +144,7 @@ def test_argmin_shapes(self, flow: TestFlow) -> None:
flow,
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_argmin_edge_cases(self, flow: TestFlow) -> None:
x = torch.tensor([[1.0, float("-inf"), 3.0], [4.0, 5.0, float("-inf")]])
self._test_op(
Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_ceil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -45,6 +47,7 @@ def test_ceil_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(CeilModel(), (torch.randn(3, 4, 5),), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_ceil_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_clamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -56,6 +58,7 @@ def test_clamp_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(model, (torch.randn(3, 4, 5),), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_clamp_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_elu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -42,5 +44,6 @@ def test_elu_f32_multi_dim(self, flow: TestFlow) -> None:
def test_elu_f32_alpha(self, flow: TestFlow) -> None:
self._test_op(Model(alpha=0.5), (torch.randn(3, 4, 5),), flow)

@unittest.skip("In place activations aren't properly defunctionalized yet.")
def test_elu_f32_inplace(self, flow: TestFlow) -> None:
self._test_op(Model(inplace=True), (torch.randn(3, 4, 5),), flow)
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -46,6 +48,7 @@ def test_exp_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(ExpModel(), (torch.randn(3, 4, 5),), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_exp_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_floor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -42,6 +44,7 @@ def test_floor_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(FloorModel(), (torch.randn(3, 4, 5),), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_floor_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_floor_divide.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# pyre-unsafe

import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -178,6 +180,7 @@ def test_floor_divide_values(self, flow: TestFlow) -> None:
y = torch.tensor([-2.0]).expand_as(x).clone()
self._test_op(model, (x, y), flow, generate_random_test_inputs=False)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_floor_divide_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases
model = FloorDivideModel()
Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_hardsigmoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -38,6 +40,7 @@ def test_hardsigmoid_f32_single_dim(self, flow: TestFlow) -> None:
def test_hardsigmoid_f32_multi_dim(self, flow: TestFlow) -> None:
self._test_op(Model(), (torch.randn(2, 3, 4, 5),), flow)

@unittest.skip("In place activations aren't properly defunctionalized yet.")
def test_hardsigmoid_f32_inplace(self, flow: TestFlow) -> None:
self._test_op(Model(inplace=True), (torch.randn(3, 4, 5),), flow)

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_hardswish.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -38,6 +40,7 @@ def test_hardswish_f32_single_dim(self, flow: TestFlow) -> None:
def test_hardswish_f32_multi_dim(self, flow: TestFlow) -> None:
self._test_op(Model(), (torch.randn(2, 3, 4, 5),), flow)

@unittest.skip("In place activations aren't properly defunctionalized yet.")
def test_hardswish_f32_inplace(self, flow: TestFlow) -> None:
self._test_op(Model(inplace=True), (torch.randn(3, 4, 5),), flow)

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_hardtanh.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -45,6 +47,7 @@ def test_hardtanh_f32_multi_dim(self, flow: TestFlow) -> None:
def test_hardtanh_f32_custom_range(self, flow: TestFlow) -> None:
self._test_op(Model(min_val=-2.0, max_val=2.0), (torch.randn(3, 4, 5),), flow)

@unittest.skip("In place activations aren't properly defunctionalized yet.")
def test_hardtanh_f32_inplace(self, flow: TestFlow) -> None:
self._test_op(Model(inplace=True), (torch.randn(3, 4, 5),), flow)

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_leaky_relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -44,6 +46,7 @@ def test_leaky_relu_f32_multi_dim(self, flow: TestFlow) -> None:
def test_leaky_relu_f32_custom_slope(self, flow: TestFlow) -> None:
self._test_op(Model(negative_slope=0.1), (torch.randn(3, 4, 5),), flow)

@unittest.skip("In place activations aren't properly defunctionalized yet.")
def test_leaky_relu_f32_inplace(self, flow: TestFlow) -> None:
self._test_op(Model(inplace=True), (torch.randn(3, 4, 5),), flow)

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -46,6 +48,7 @@ def test_log_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(LogModel(), (torch.rand(3, 4, 5) + 0.01,), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_log_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases
# Tensor with infinity
Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_log10.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -46,6 +48,7 @@ def test_log10_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(Log10Model(), (torch.rand(3, 4, 5) + 0.01,), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_log10_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases
# Tensor with infinity
Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_log1p.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -46,6 +48,7 @@ def test_log1p_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(Log1pModel(), (torch.rand(3, 4, 5) * 2 - 0.5,), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_log1p_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases
# Tensor with infinity
Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_log2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -46,6 +48,7 @@ def test_log2_shapes(self, flow: TestFlow) -> None:
# 3D tensor
self._test_op(Log2Model(), (torch.rand(3, 4, 5) + 0.01,), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_log2_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases
# Tensor with infinity
Expand Down
2 changes: 2 additions & 0 deletions backends/test/suite/operators/test_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# pyre-unsafe

import unittest
from typing import List, Optional, Tuple, Union

import torch
Expand Down Expand Up @@ -229,6 +230,7 @@ def test_mean_shapes(self, flow: TestFlow) -> None:
flow,
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_mean_edge_cases(self, flow: TestFlow) -> None:
x = torch.tensor([[1.0, float("inf"), 3.0], [4.0, 5.0, float("inf")]])
self._test_op(
Expand Down
2 changes: 2 additions & 0 deletions backends/test/suite/operators/test_median.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# pyre-unsafe

import unittest
from typing import Optional

import torch
Expand Down Expand Up @@ -167,6 +168,7 @@ def test_median_shapes(self, flow: TestFlow) -> None:
# 5D tensor
self._test_op(MedianValueOnlyModel(), (torch.randn(2, 2, 3, 4, 5),), flow)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_median_edge_cases(self, flow: TestFlow) -> None:
# Tensor with NaN (NaN should be propagated)
x = torch.tensor([[1.0, float("nan"), 3.0], [4.0, 5.0, float("nan")]])
Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_neg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# pyre-unsafe

import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -55,6 +57,7 @@ def test_neg_shapes(self, flow: TestFlow) -> None:
NegModel(), (torch.randn(3, 4, 5),), flow, generate_random_test_inputs=False
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_neg_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_pow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# pyre-unsafe

import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -127,6 +129,7 @@ def test_pow_shapes(self, flow: TestFlow) -> None:
model, (torch.rand(3, 4, 5) + 0.1,), flow, generate_random_test_inputs=False
)

@unittest.skip("NaN and Inf are not enforced for backends.")
def test_pow_edge_cases(self, flow: TestFlow) -> None:
# Test edge cases

Expand Down
3 changes: 3 additions & 0 deletions backends/test/suite/operators/test_relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# pyre-unsafe


import unittest

import torch
from executorch.backends.test.suite.flow import TestFlow

Expand Down Expand Up @@ -38,5 +40,6 @@ def test_relu_f32_single_dim(self, flow: TestFlow) -> None:
def test_relu_f32_multi_dim(self, flow: TestFlow) -> None:
self._test_op(Model(), (torch.randn(2, 3, 4, 5),), flow)

@unittest.skip("In place activations aren't properly defunctionalized yet.")
def test_relu_f32_inplace(self, flow: TestFlow) -> None:
self._test_op(Model(inplace=True), (torch.randn(3, 4, 5),), flow)
Loading
Loading