mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-05 16:44:58 +08:00
Improve SymInt print and move to correct file (#85413)
Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/85413 Approved by: https://github.com/wconstab
This commit is contained in:
committed by
PyTorch MergeBot
parent
3a09a1e8f0
commit
a2cbbbd46f
@ -26,14 +26,4 @@ at::IntArrayRef asIntArrayRefUnchecked(c10::SymIntArrayRef ar) {
|
||||
return IntArrayRef(reinterpret_cast<const int64_t*>(ar.data()), ar.size());
|
||||
}
|
||||
|
||||
// TODO: this print is bad
|
||||
std::ostream& operator<<(std::ostream& os, SymInt s) {
|
||||
if (s.is_symbolic()) {
|
||||
os << "SymInt(" << s.toSymIntNodeImpl()->str() << ")";
|
||||
} else {
|
||||
os << "SymInt(" << s.as_int_unchecked() << ")";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace c10
|
||||
|
||||
Reference in New Issue
Block a user