8000 Remove C10_EMBEDDED (#144808) · pytorch/pytorch@69b883d · GitHub 10000
[go: up one dir, main page]

Skip to content

Commit 69b883d

Browse files
swolchokpytorchmergebot
authored andcommitted
Remove C10_EMBEDDED (#144808)
I added this to support code sharing with ExecuTorch, but the operator<< overrides are load-bearing for builds -- we have other code that attempts to pretty-print Half/BFloat16, and implicit conversions can't be used to make that work because there are *multiple* implicit conversions from Half/BFloat16 to primitive types, so which one to select is ambiguous. Also, we don't actually seem to need it now in ExecuTorch core because we have `include <ostream>` in there at the moment anyway. Pull Request resolved: #144808 Approved by: https://github.com/janeyx99, https://github.com/malfet
1 parent b801210 commit 69b883d

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

c10/util/BFloat16.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
#include <cstdint>
99
#include <cstring>
1010
#include <iosfwd>
11-
#ifndef C10_EMBEDDED
1211
#include <ostream>
13-
#endif // C10_EMBEDDED
1412

1513
#if defined(__CUDACC__) && !defined(USE_ROCM)
1614
#include <cuda_bf16.h>
@@ -116,14 +114,12 @@ struct alignas(2) BFloat16 {
116114
#endif
117115
};
118116

119-
#ifndef C10_EMBEDDED
120117
C10_API inline std::ostream& operator<<(
121118
std::ostream& out,
122119
const BFloat16& value) {
123120
out << (float)value;
124121
return out;
125122
}
126-
#endif // C10_EMBEDDED
127123

128124
} // namespace c10
129125

c10/util/Half.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
#include <cstring>
3030
#include <iosfwd>
3131
#include <limits>
32-
#ifndef C10_EMBEDDED
3332
#include <ostream>
34-
#endif // C10_EMBEDDED
3533

3634
#ifdef __CUDACC__
3735
#include <cuda_fp16.h>
@@ -411,12 +409,10 @@ struct alignas(2) Half {
411409
#endif
412410
};
413411

414-
#ifndef C10_EMBEDDED
415412
C10_API inline std::ostream& operator<<(std::ostream& out, const Half& value) {
416413
out << (float)value;
417414
return out;
418415
}
419-
#endif // C10_EMBEDDED
420416

421417
} // namespace c10
422418

0 commit comments

Comments
 (0)
0