File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
6
6
namespace torch_xla {
7
7
8
+ #define _XLA_STATUS_VAR _statusor
9
+
8
10
#define _XLA_RETURN_IF_ERROR_AND_THEN (REXPR, ...) \
9
11
{ \
10
- auto & _statusor = (REXPR); \
11
- if (!_statusor .ok ()) { \
12
- return _statusor .status (); \
12
+ auto & _XLA_STATUS_VAR = (REXPR); \
13
+ if (!_XLA_STATUS_VAR .ok ()) { \
14
+ return _XLA_STATUS_VAR .status (); \
13
15
} \
14
16
__VA_ARGS__ \
15
17
}
@@ -20,7 +22,8 @@ namespace torch_xla {
20
22
// Propagates `REXPR`, in case it's a non-ok status. Otherwise, assign
21
23
// its result to `LHS`.
22
24
#define XLA_ASSIGN_OR_RETURN (LHS, REXPR ) \
23
- _XLA_RETURN_IF_ERROR_AND_THEN (REXPR, { LHS = std::move (_status.value ()); })
25
+ _XLA_RETURN_IF_ERROR_AND_THEN (REXPR, \
26
+ { LHS = std::move (_XLA_STATUS_VAR.value ()); })
24
27
25
28
// Consumes the `status` and maybe throws an exception if `status` has
26
29
// a non-ok code.
You can’t perform that action at this time.
0 commit comments