Skip to content

Commit 6f3cf07

Browse files
committed
Safely assign xtensor to prevent build error
1 parent 8a5875a commit 6f3cf07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_xla/csrc/init_python_bindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ std::string GetTensorsHloGraph(const std::vector<at::Tensor>& tensors,
761761
}
762762

763763
std::optional<xla::OpSharding> GetXLAOpSharding(const at::Tensor& input) {
764-
XLATensorPtr xtensor = bridge::GetXlaTensor(input);
764+
XLA_ASSIGN_OR_THROW(XLATensorPtr xtensor, bridge::GetXlaTensor(input));
765765
XLATensor::ShardingSpecPtr sharding_spec =
766766
xtensor ? xtensor->sharding_spec() : nullptr;
767767
if (sharding_spec != nullptr) {

0 commit comments

Comments
 (0)