Skip to content

Commit 9c0e2c0

Browse files
committed
Safely assign xtensor to prevent build error
1 parent 3f2af6b commit 9c0e2c0

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
@@ -753,7 +753,7 @@ std::string GetTensorsHloGraph(const std::vector<at::Tensor>& tensors,
753753
}
754754

755755
std::optional<xla::OpSharding> GetXLAOpSharding(const at::Tensor& input) {
756-
XLATensorPtr xtensor = bridge::GetXlaTensor(input);
756+
XLA_ASSIGN_OR_THROW(XLATensorPtr xtensor, bridge::GetXlaTensor(input));
757757
XLATensor::ShardingSpecPtr sharding_spec =
758758
xtensor ? xtensor->sharding_spec() : nullptr;
759759
if (sharding_spec != nullptr) {

0 commit comments

Comments
 (0)