mirror of https://github.com/llvm/torch-mlir
parent
a893c7d5cf
commit
d3c08376af
|
@ -160,4 +160,5 @@ TOSA_PASS_SET = {
|
||||||
"ElementwiseNeIntScalarModule_basic",
|
"ElementwiseNeIntScalarModule_basic",
|
||||||
"ElementwiseNeFloatTensorModule_basic",
|
"ElementwiseNeFloatTensorModule_basic",
|
||||||
"ConvolutionModule2DStatic_basic",
|
"ConvolutionModule2DStatic_basic",
|
||||||
|
"ElementwiseNegModule_basic",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1282,3 +1282,23 @@ class ElementwiseCosIntModule(torch.nn.Module):
|
||||||
@register_test_case(module_factory=lambda: ElementwiseCosIntModule())
|
@register_test_case(module_factory=lambda: ElementwiseCosIntModule())
|
||||||
def ElementwiseCosIntModule_basic(module, tu: TestUtils):
|
def ElementwiseCosIntModule_basic(module, tu: TestUtils):
|
||||||
module.forward(torch.randint(1, 10, (3, 4), dtype=torch.int32))
|
module.forward(torch.randint(1, 10, (3, 4), dtype=torch.int32))
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
class ElementwiseNegModule(torch.nn.Module):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
@export
|
||||||
|
@annotate_args([
|
||||||
|
None,
|
||||||
|
([-1, -1], torch.float32, True),
|
||||||
|
])
|
||||||
|
|
||||||
|
def forward(self, a):
|
||||||
|
return torch.neg(a)
|
||||||
|
|
||||||
|
|
||||||
|
@register_test_case(module_factory=lambda: ElementwiseNegModule())
|
||||||
|
def ElementwiseNegModule_basic(module, tu: TestUtils):
|
||||||
|
module.forward(tu.rand(3, 4))
|
||||||
|
|
Loading…
Reference in New Issue