Skip to content

Commit

Permalink
- bool is legit IntImm
Browse files Browse the repository at this point in the history
  • Loading branch information
mbs-octoml committed May 6, 2022
1 parent c655b0f commit 088671f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/support/scalars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ std::string IntImmToString(const IntImm& int_imm) {
os << int_imm->value;
} else if (int_imm->dtype == kInt64) {
os << int_imm->value << "i64";
} else if (int_imm->dtype == kBool) {
os << (int_imm->value ? "True" : "False");
} else {
LOG(FATAL) << "Unrecognised IntImm dtype: " << DLDataType2String(int_imm->dtype);
}
Expand All @@ -150,8 +152,6 @@ std::string FloatImmToString(const FloatImm& float_imm) {
return os.str();
}

std::string BoolToString(bool value) { return value ? "True" : "False"; }

std::pair<IntImm, bool> ValueToIntImm(int64_t value, int width) {
bool clipped = false;
if (width == 16) {
Expand Down
1 change: 0 additions & 1 deletion src/support/scalars.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ std::string NDArrayScalarToString(const runtime::NDArray& data);
/*! \brief Returns Relay literal text for given TIR immediate. */
std::string IntImmToString(const IntImm& int_imm);
std::string FloatImmToString(const FloatImm& float_imm);
std::string BoolToString(bool value);

/*!
* \brief Returns TIR immediate for given value and width. Boolean will be true if value
Expand Down

0 comments on commit 088671f

Please sign in to comment.