Fix several typos (#83823)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83823
Approved by: https://github.com/ngimel, https://github.com/kit1980
This commit is contained in:
SmirnovKol
2022-09-01 17:56:50 +00:00
committed by PyTorch MergeBot
parent 7a348a1d4a
commit 041edeeecb
3 changed files with 5 additions and 8 deletions

View File

@ -200,7 +200,7 @@ inline void deprecated_AT_DISPATCH_ALL_TYPES_AND_HALF_AND_COMPLEX() {}
// conditionally compile fragments of the case statements such
// that the kernel functions are specialized only for the dtypes
// that are needed. The NAME parameter *must* be a build time
// cons char* (can't be std::string, etc...)
// const char* (can't be std::string, etc...)
//
// Please ensure that the NAME is unique for every implementation
// or you run the risk of over-including code for the kernel

View File

@ -103,7 +103,7 @@ struct ScalarTypeToCPPType;
/* This is a workaround for the CUDA bug which prevents */ \
/* ::detail::ScalarTypeToCType<T>::type being used directly due to */ \
/* ambiguous reference which can't to be resolved. For some reason it */ \
/* cant pick between at::detail and at::cuda::detail. */ \
/* can't pick between at::detail and at::cuda::detail. */ \
/* For repro example, please see: */ \
/* https://gist.github.com/izdeby/952ae7cf256ddb740a73776d39a7e7ba */ \
/* TODO: remove once the bug is fixed. */ \

View File

@ -108,7 +108,7 @@ PyObject* THPDTypeInfo_compare(THPDTypeInfo* a, THPDTypeInfo* b, int op) {
static PyObject* THPDTypeInfo_bits(THPDTypeInfo* self, void*) {
// NOLINTNEXTLINE(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions,cppcoreguidelines-avoid-magic-numbers)
int bits = elementSize(self->type) * 8;
int64_t bits = elementSize(self->type) * 8;
return THPUtils_packInt64(bits);
}
@ -220,13 +220,10 @@ PyObject* THPFInfo_str(THPFInfo* self) {
}
PyObject* THPIInfo_str(THPIInfo* self) {
auto type = self->type;
std::string primary_name, legacy_name;
std::tie(primary_name, legacy_name) = torch::utils::getDtypeNames(type);
std::ostringstream oss;
oss << "iinfo(min=" << PyFloat_AsDouble(THPIInfo_min(self, nullptr));
oss << ", max=" << PyFloat_AsDouble(THPIInfo_max(self, nullptr));
oss << "iinfo(min=" << PyLong_AsDouble(THPIInfo_min(self, nullptr));
oss << ", max=" << PyLong_AsDouble(THPIInfo_max(self, nullptr));
oss << ", dtype=" << PyUnicode_AsUTF8(THPIInfo_dtype(self, nullptr)) << ")";
return THPUtils_packString(oss.str().c_str());