Add an error message when HLO casting fails.
PiperOrigin-RevId: 358236260 Change-Id: I3085b13d9f3a7324b73546d2abffafa24694eb71
This commit is contained in:
parent
27572e0ad4
commit
52a0e1534c
@ -39,7 +39,9 @@ template <class T, EnableIfDerivedFromHlo<T>* = nullptr>
|
||||
const T* Cast(const HloInstruction* instruction) {
|
||||
CHECK(instruction != nullptr);
|
||||
const T* casted = dynamic_cast<const T*>(instruction);
|
||||
CHECK(casted != nullptr);
|
||||
CHECK(casted != nullptr)
|
||||
<< "Invalid HloInstruction casting. Destination Type: "
|
||||
<< typeid(T).name();
|
||||
return casted;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user