Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvegamyhre committed Nov 9, 2023
1 parent 3bb3b93 commit 94fb2e3
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions torch_xla/csrc/aten_xla_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,23 +1331,22 @@ at::Tensor XLANativeFunctions::fmod(const at::Tensor& self,
});
}

at::Tensor XLANativeFunctions::full(at::IntArrayRef size,
const at::Scalar & fill_value,
c10::optional<at::ScalarType> dtype,
c10::optional<at::Layout> layout,
c10::optional<at::Device> device,
at::Tensor XLANativeFunctions::full(at::IntArrayRef size,
const at::Scalar& fill_value,
c10::optional<at::ScalarType> dtype,
c10::optional<at::Layout> layout,
c10::optional<at::Device> device,
c10::optional<bool> pin_memory) {
TORCH_LAZY_FN_COUNTER("xla::");
// Fall back to CPU if layout or pin_memory are not default
if (layout.value_or(at::Layout::Strided) != at::Layout::Strided || pin_memory.value_or(false)) {
return at::native::call_fallback_fn<&xla_cpu_fallback, ATEN_OP(full)>::call(size, fill_value, dtype, layout, device, pin_memory);
if (layout.value_or(at::Layout::Strided) != at::Layout::Strided ||
pin_memory.value_or(false)) {
return at::native::call_fallback_fn<&xla_cpu_fallback, ATEN_OP(full)>::call(
size, fill_value, dtype, layout, device, pin_memory);
}
return bridge::AtenFromXlaTensor(tensor_methods::full(
absl::Span<const int64_t>(size),
fill_value,
GetXlaDeviceOrCurrent(device),
at::dtype_or_default(dtype)
));
absl::Span<const int64_t>(size), fill_value,
GetXlaDeviceOrCurrent(device), at::dtype_or_default(dtype)));
}

at::Tensor XLANativeFunctions::gather(const at::Tensor& self, int64_t dim,
Expand Down

0 comments on commit 94fb2e3

Please sign in to comment.