File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1521,8 +1521,17 @@ Error Method::execute_instruction() {
15211521 // We know that instr_args_as_FreeCall is non-null because it was checked
15221522 // at init time.
15231523 auto free_call = instruction->instr_args_as_FreeCall ();
1524- auto t = mutable_value (free_call->value_index ()).toTensor ();
1525- internal::reset_data_ptr (t);
1524+ auto & val = mutable_value (free_call->value_index ());
1525+ if (val.isTensor ()) {
1526+ auto & t = val.toTensor ();
1527+ internal::reset_data_ptr (t);
1528+ } else {
1529+ ET_LOG (
1530+ Error,
1531+ " FreeCall target at index %u is not a Tensor" ,
1532+ static_cast <unsigned int >(free_call->value_index ()));
1533+ err = Error::InvalidProgram;
1534+ }
15261535 } break ;
15271536 default :
15281537 ET_LOG (
You can’t perform that action at this time.
0 commit comments