Skip to content

Commit

Permalink
Fix isIntegralType error msg (#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev committed Jun 30, 2022
1 parent 0c82ecf commit ebf23a5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions torch/csrc/jit/codegen/cuda/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ DataType indexModeToDtype(KernelIndexMode index_mode) {

bool isFloatingPointType(DataType dtype) {
switch (dtype) {
case DataType::Bool:
return false;
case DataType::Double:
case DataType::Float:
case DataType::Half:
case DataType::BFloat16:
return true;
case DataType::Bool:
case DataType::Index:
case DataType::Int:
case DataType::Int32:
Expand Down Expand Up @@ -78,10 +77,9 @@ bool isIntegralType(DataType dtype) {
case DataType::Int32:
return true;
case DataType::Null:
TORCH_CHECK(
false, "Null type is not a valid argument to isFloatingPoint");
TORCH_CHECK(false, "Null type is not a valid argument to isIntegralType");
default:
TORCH_CHECK(false, "Type not supported in isFloatingPoint");
TORCH_CHECK(false, "Type not supported in isIntegralType");
}
}

Expand Down

0 comments on commit ebf23a5

Please sign in to comment.