Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion experimental/torch_xla2/test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"nn.functional.conv_transpose2d",
"nn.functional.conv_transpose3d",
"nn.functional.cosine_embedding_loss",
"nn.functional.cosine_similarity",
"nn.functional.ctc_loss",
"nn.functional.dropout2d",
"nn.functional.dropout3d",
Expand Down
5 changes: 5 additions & 0 deletions experimental/torch_xla2/torch_xla2/ops/jaten.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
# squeeze_ is expected to change tensor's shape. So replace with new value
torch.ops.aten.squeeze_: (torch.ops.aten.squeeze, True),
torch.ops.aten.clamp_: torch.ops.aten.clamp,
torch.ops.aten.clamp_min_: torch.ops.aten.clamp_min,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want to add this op here?

torch.ops.aten.ceil_: torch.ops.aten.ceil,
torch.ops.aten.logical_not_: torch.ops.aten.logical_not,
torch.ops.aten.unsqueeze_: torch.ops.aten.unsqueeze,
Expand Down Expand Up @@ -2152,6 +2153,10 @@ def _aten_broadcast_to(input, shape):
def _aten_clamp(self, min=None, max=None):
return jnp.clip(self, min, max)

@op(torch.ops.aten.clamp_min)
def _aten_clamp_min(input, min):
return jnp.clip(input, min=min)


# aten.constant_pad_nd
@op(torch.ops.aten.constant_pad_nd)
Expand Down
Loading