mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Skip storage check debug assert in view codegen when output is a subclass instance (#122718)
Before the fix, this assert blows up in DEBUG mode for views where the input (base) is a dense tensor and the output (view) is a subclass instance. Pull Request resolved: https://github.com/pytorch/pytorch/pull/122718 Approved by: https://github.com/soulitzer
This commit is contained in:
parent
105381ea11
commit
eb5381da66
|
|
@ -417,7 +417,8 @@ ENFORCE_SAME_TENSOR_STORAGE = CodeTemplate(
|
|||
"""\
|
||||
if (${tensor_name}_storage_saved.has_value() &&
|
||||
!at::impl::dispatch_mode_enabled() &&
|
||||
!at::impl::tensor_has_dispatch(${tensor_name}))
|
||||
!at::impl::tensor_has_dispatch(${tensor_name}) &&
|
||||
!at::impl::tensor_has_dispatch(${out_tensor_name}))
|
||||
TORCH_INTERNAL_ASSERT(${tensor_name}_storage_saved.value().is_alias_of(${out_tensor_name}.storage()));
|
||||
"""
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user