mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Disambiguate error message for working with not fully refined tuple types (#55745)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55745 Test Plan: Imported from OSS Reviewed By: gmagogsfm Differential Revision: D27698691 Pulled By: tugsbayasgalan fbshipit-source-id: 7855042d37290f19d53adfc0b4da606430501663
This commit is contained in:
committed by
Facebook GitHub Bot
parent
facbcec298
commit
b80c6f863f
@ -238,6 +238,9 @@ std::vector<std::shared_ptr<SugaredValue>> SimpleValue::asTuple(
|
||||
Node* unpack =
|
||||
graph->insertNode(graph->createListUnpack(value_, *size_hint));
|
||||
return fmap(unpack->outputs(), make_simple_value);
|
||||
} else if (value_->type()->kind() == TypeKind::AnyTupleType) {
|
||||
throw ErrorReport(loc)
|
||||
<< "Provided tuple is not fully defined/refined including its element types, please provide a value of type like Tuple[int, int]";
|
||||
}
|
||||
throw ErrorReport(loc) << value_->type()->repr_str()
|
||||
<< " cannot be used as a tuple";
|
||||
|
Reference in New Issue
Block a user