mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
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: https://github.com/pytorch/pytorch/pull/144808 Approved by: https://github.com/janeyx99, https://github.com/malfet
This commit is contained in:
parent
b801210035
commit
69b883d7ac
2 changed files with 0 additions and 8 deletions
|
|
@ -8,9 +8,7 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#ifndef C10_EMBEDDED
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#endif // C10_EMBEDDED
|
|
||||||
|
|
||||||
#if defined(__CUDACC__) && !defined(USE_ROCM)
|
#if defined(__CUDACC__) && !defined(USE_ROCM)
|
||||||
#include <cuda_bf16.h>
|
#include <cuda_bf16.h>
|
||||||
|
|
@ -116,14 +114,12 @@ struct alignas(2) BFloat16 {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef C10_EMBEDDED
|
|
||||||
C10_API inline std::ostream& operator<<(
|
C10_API inline std::ostream& operator<<(
|
||||||
std::ostream& out,
|
std::ostream& out,
|
||||||
const BFloat16& value) {
|
const BFloat16& value) {
|
||||||
out << (float)value;
|
out << (float)value;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
#endif // C10_EMBEDDED
|
|
||||||
|
|
||||||
} // namespace c10
|
} // namespace c10
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#ifndef C10_EMBEDDED
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#endif // C10_EMBEDDED
|
|
||||||
|
|
||||||
#ifdef __CUDACC__
|
#ifdef __CUDACC__
|
||||||
#include <cuda_fp16.h>
|
#include <cuda_fp16.h>
|
||||||
|
|
@ -411,12 +409,10 @@ struct alignas(2) Half {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef C10_EMBEDDED
|
|
||||||
C10_API inline std::ostream& operator<<(std::ostream& out, const Half& value) {
|
C10_API inline std::ostream& operator<<(std::ostream& out, const Half& value) {
|
||||||
out << (float)value;
|
out << (float)value;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
#endif // C10_EMBEDDED
|
|
||||||
|
|
||||||
} // namespace c10
|
} // namespace c10
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue