Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new_empty #8087

Merged
merged 1 commit into from
Sep 27, 2024
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
2 changes: 1 addition & 1 deletion experimental/torch_xla2/test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"multinomial",
"mvlgamma",
"nanmedian",
"new_empty",
"new_empty_strided",
"nextafter",
"nn.functional.adaptive_avg_pool3d",
Expand Down Expand Up @@ -167,6 +166,7 @@
'empty_permuted',
'empty_strided',
'bernoulli',
"new_empty",
'randint_like',
'randn',
'randn_like',
Expand Down
7 changes: 5 additions & 2 deletions experimental/torch_xla2/torch_xla2/ops/jaten.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,6 @@ def _aten__to_copy(self, **kwargs):
return jnp.copy(self)




@op(torch.ops.aten.empty)
@op_base.convert_dtype()
def _aten_empty(size: Sequence[int], *, dtype=None, **kwargs):
Expand Down Expand Up @@ -3930,6 +3928,11 @@ def _aten_flatten(x, start_dim=0, end_dim=-1):
return jnp.reshape(x, new_shape)


@op(torch.ops.aten.new_empty)
def _new_empty(self, size, **kwargs):
return jnp.empty(size)


@op(torch.ops.aten.new_empty_strided)
def _new_empty_strided(self, size, stride, **kwargs):
return jnp.empty(size)
Expand Down
Loading