AT_ERROR("Expected object of scalar type ", scalar_type, " but got scalar type ", expr.scalar_type(),
" for argument #", pos, " '", name, "'");
}
+ if (expr.is_variable()) {
+ AT_ERROR("Expected Tensor (not Variable) for argument #", pos, " '", name, "'");
+ }
return expr.unsafeGetTensorImpl();
}
}
if (expr.scalar_type() != scalar_type) {
AT_ERROR("Expected object of scalar type ", scalar_type, " but got scalar type ", expr.scalar_type(),
- " for sequence elment ", i , " in sequence argument at position #", pos, " '", name, "'");
+ " for sequence element ", i , " in sequence argument at position #", pos, " '", name, "'");
+ }
+ if (expr.is_variable()) {
+ AT_ERROR("Expected Tensor (not Variable) for sequence element ",
+ i , " in sequence argument at position #", pos, " '", name, "'");
}
unwrapped.emplace_back(expr.unsafeGetTensorImpl());
}