mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
Improve char printing (#167899)
This PR outputs chars to stream without building temporary strings. They were modified by (on fish) ``` sed -i -e 's/<< "\([^\\\']\)"/<< \'\1\'/g' (grep '<< "."' -r torch c10 aten -l) ``` and revert some invalid changes. Pull Request resolved: https://github.com/pytorch/pytorch/pull/167899 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
2f023bf7b9
commit
5605fce2c8
@@ -435,7 +435,7 @@ TEST(DispatchKeySet, TestFunctionalityDispatchKeyToString) {
|
||||
if (i > 0) {
|
||||
ASSERT_TRUE(res.find("Unknown") == std::string::npos)
|
||||
<< i << " (before is " << toString(static_cast<DispatchKey>(i - 1))
|
||||
<< ")";
|
||||
<< ')';
|
||||
} else {
|
||||
ASSERT_TRUE(res.find("Unknown") == std::string::npos) << i;
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ TEST(HalfConversionTest, TestPorableConversion) {
|
||||
for (auto x : inputs) {
|
||||
auto target = c10::detail::fp16_ieee_to_fp32_value(x);
|
||||
EXPECT_EQ(halfbits2float(x), target)
|
||||
<< "Test failed for uint16 to float " << x << "\n";
|
||||
<< "Test failed for uint16 to float " << x << '\n';
|
||||
EXPECT_EQ(
|
||||
float2halfbits(target), c10::detail::fp16_ieee_from_fp32_value(target))
|
||||
<< "Test failed for float to uint16" << target << "\n";
|
||||
<< "Test failed for float to uint16" << target << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ struct Noncopyable {
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const Noncopyable& nc) {
|
||||
out << "Noncopyable(" << nc.x << ")";
|
||||
out << "Noncopyable(" << nc.x << ')';
|
||||
return out;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user