Skip to content

Commit

Permalink
Fix deprecation warning in scalar_type_analysis (pytorch#50218)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#50218

Reviewed By: janeyx99

Differential Revision: D25827971

Pulled By: malfet

fbshipit-source-id: a4e467721435d7ae0db2195694053621eee8c2ee
  • Loading branch information
malfet authored and hwangdeyu committed Jan 14, 2021
1 parent 88224d0 commit 0c87fde
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions torch/csrc/jit/passes/onnx/scalar_type_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ static bool IsStandardOp(const NodeKind& nkind) {

// For these operators, all inputs share the same scalar type.
// The output scalar type is always Bool.
static const std::unordered_set<NodeKind> comparisonOps = {onnx::Greater,
onnx::Less,
onnx::Equal,
onnx::GreaterOrEqual,
onnx::LessOrEqual};
static const std::unordered_set<NodeKind> comparisonOps = {
onnx::Greater,
onnx::Less,
onnx::Equal,
onnx::GreaterOrEqual,
onnx::LessOrEqual,
};

static bool IsComparisonOp(const NodeKind& nkind) {
return comparisonOps.find(nkind) != comparisonOps.end();
Expand Down Expand Up @@ -103,7 +105,7 @@ static c10::optional<c10::ScalarType> PromoteScalarTypesWithCategory(
if (c10::kBool == t) {
return 1;
}
if (c10::isIntegralType(t)) {
if (c10::isIntegralType(t, /*includeBool=*/false)) {
return 2;
}
if (c10::isFloatingType(t)) {
Expand Down

0 comments on commit 0c87fde

Please sign in to comment.