Skip to content

Commit 456ba32

Browse files
committed
Rename ExtractValue to make its semantics clearer.
1 parent 2f6bce7 commit 456ba32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

torch_xla/csrc/runtime/util.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ T Multiply(const S& input) {
132132

133133
namespace internal {
134134

135-
// ExtractValue<U>::type is T if U is absl::StatusOr<T>, and is undefined
136-
// otherwise.
135+
// ExtractStatusOrValue<U>::type is T if U is absl::StatusOr<T>, and is
136+
// undefined otherwise.
137137
template <typename U>
138-
struct ExtractValue;
138+
struct ExtractStatusOrValue;
139139
template <typename T>
140-
struct ExtractValue<absl::StatusOr<T>> {
140+
struct ExtractStatusOrValue<absl::StatusOr<T>> {
141141
using type = T;
142142
};
143143

@@ -158,7 +158,7 @@ struct ExtractValue<absl::StatusOr<T>> {
158158
// catch it; therefore we should ensure that `func()` never
159159
// crashes (and fix any crash as a bug).
160160
template <typename Func>
161-
typename internal::ExtractValue<decltype(std::declval<Func>()())>::type
161+
typename internal::ExtractStatusOrValue<decltype(std::declval<Func>()())>::type
162162
RaisePythonValueErrorOnFailure(const Func& func) {
163163
decltype(std::declval<Func>()()) result;
164164
try {

0 commit comments

Comments
 (0)