Skip to content

Commit a81964f

Browse files
committed
Lower lift and lift_copy ops
1 parent 219929d commit a81964f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

test/pytorch_test_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
'test_random_to_xla', # doesn't raise
193193
'test_copy_', # test against complex32 which is nto supported
194194
'test_assertRaisesRegex_ignore_msg_non_native_device_xla', # segfault on wheel sanity test
195+
'test_index_reduce', # takes too long
195196
},
196197

197198
# test_view_ops.py

torch_xla/csrc/aten_xla_type.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,19 @@ at::Tensor XLANativeFunctions::lerp(const at::Tensor& self,
14671467
bridge::GetXlaTensor(self), bridge::GetXlaTensor(end), weight));
14681468
}
14691469

1470+
at::Tensor XLANativeFunctions::lift_fresh(const at::Tensor& self) {
1471+
std::cout << "WONJOO: at aten_xla_type.cpp, lift_fresh" << std::endl;
1472+
return at::functionalization::impl::to_functional_tensor(self);
1473+
// return at::functionalization::functionalize_aten_op<ATEN_OP(
1474+
// lift_fresh)>::call(self);
1475+
}
1476+
1477+
at::Tensor XLANativeFunctions::lift_fresh_copy(const at::Tensor& self) {
1478+
std::cout << "WONJOO: at aten_xla_type.cpp, lift_fresh_copy" << std::endl;
1479+
return at::functionalization::functionalize_aten_op<ATEN_OP(
1480+
lift_fresh_copy)>::call(self);
1481+
}
1482+
14701483
at::Tensor XLANativeFunctions::linspace(const at::Scalar& start,
14711484
const at::Scalar& end, int64_t steps,
14721485
c10::optional<at::ScalarType> dtype,

xla_native_functions.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ supported:
197197
- leaky_relu_backward
198198
- lerp.Scalar
199199
- lerp.Tensor
200+
- lift_fresh
201+
- lift_fresh_copy
200202
- linspace
201203
- log
202204
- log1p

0 commit comments

Comments
 (0)