Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 595fe44

Browse files
committed
update AOT test
1 parent e8b4efd commit 595fe44

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/AotCompile/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ AOT_TEST_SUITE = [
2121
("tanh", False),
2222
("clamp", False),
2323
("relu", False),
24+
("log1p", False),
2425
("round_even", False),
2526
("sqrt_float", False),
2627
("sqrt_int", False),

test/AotCompile/model_loader_lib.py

+18
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,24 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
263263
return TorchLoaderOutput(model=Relu(), inputs=(x,), dynamic_shapes=dynamic_shapes)
264264

265265

266+
def log1p_loader() -> TorchLoaderOutput:
267+
class Log1p(torch.nn.Module):
268+
def __init__(self):
269+
super().__init__()
270+
271+
def forward(self, x: torch.Tensor) -> torch.Tensor:
272+
return torch.log1p(x)
273+
274+
# Sample inputs
275+
x = torch.randn(2, 3)
276+
277+
# Dynamic dim constraints
278+
batch = Dim("batch")
279+
dynamic_shapes = {"x": {0: batch}}
280+
281+
return TorchLoaderOutput(model=Log1p(), inputs=(x,), dynamic_shapes=dynamic_shapes)
282+
283+
266284
def round_even_loader() -> TorchLoaderOutput:
267285
class RoundEven(torch.nn.Module):
268286
def __init__(self):

0 commit comments

Comments
 (0)