MCPcopy Create free account
hub / github.com/pytorch/executorch / _does_not_overlap

Function _does_not_overlap

exir/memory_planning.py:769–779  ·  view source on GitHub ↗

r""" Check if a shared object and a tensor do not overlap.

(sobj: SharedObject, spec: TensorSpec)

Source from the content-addressed store, hash-verified

767
768
769def _does_not_overlap(sobj: SharedObject, spec: TensorSpec) -> bool:
770 r"""
771 Check if a shared object and a tensor do not overlap.
772 """
773 for alloc in sobj.allocations:
774 if not (
775 spec.lifetime[1] < alloc.spec.lifetime[0]
776 or spec.lifetime[0] > alloc.spec.lifetime[1]
777 ):
778 return False
779 return True
780
781
782def _find_max_overlapping_allocations_offset(

Callers 1

pick_shared_objFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected