mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[ez] add docblock for _eval_is_non_overlapping_and_dense (#154399)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/154399 Approved by: https://github.com/laithsakka ghstack dependencies: #154400, #154398, #154396
This commit is contained in:
parent
0f56318152
commit
0c00e32632
|
|
@ -2368,6 +2368,19 @@ def eval_is_non_overlapping_and_dense(
|
|||
def _eval_is_non_overlapping_and_dense(
|
||||
sizes: Sequence[int], strides: Sequence[int]
|
||||
) -> bool:
|
||||
"""
|
||||
Evaluates whether a tensor with the given sizes and strides is non-overlapping and dense.
|
||||
|
||||
A tensor is non-overlapping if there's no memory location that belongs to more than one element.
|
||||
A tensor is dense if all elements are stored in memory without gaps.
|
||||
|
||||
Args:
|
||||
sizes: Sequence of dimension sizes for the tensor
|
||||
strides: Sequence of strides for the tensor
|
||||
|
||||
Returns:
|
||||
True if the tensor is non-overlapping and dense, False otherwise
|
||||
"""
|
||||
dim = len(sizes)
|
||||
|
||||
# Short-circuits for tensors of rank one, which are
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user