mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-04 08:00:58 +08:00
add native view_copy.out ops, teach codegen about tensorlist out=
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76126 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
a325fa94b9
commit
edc904d6ba
@ -201,7 +201,10 @@ def returntype_type(t: Type, *, mutable: bool) -> CType:
|
||||
elif t.name == BaseTy.Scalar:
|
||||
return BaseCType(scalarT)
|
||||
elif isinstance(t, ListType):
|
||||
elem = returntype_type(t.elem, mutable=mutable)
|
||||
assert (
|
||||
not mutable
|
||||
), "Native functions should never return a mutable tensor list. They should return void."
|
||||
elem = returntype_type(t.elem, mutable=False)
|
||||
assert t.size is None, f"fixed size list returns not supported: {t}"
|
||||
return VectorCType(elem)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user