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

Method any_in_common

backends/vulkan/utils.py:942–950  ·  view source on GitHub ↗

Check if this TensorRepr has any representations in common with another TensorRepr.

(self, other: "TensorRepSet")

Source from the content-addressed store, hash-verified

940 raise RuntimeError(f"Unsupported storage type {storage.storage_type}")
941
942 def any_in_common(self, other: "TensorRepSet") -> bool:
943 """
944 Check if this TensorRepr has any representations in common with another
945 TensorRepr.
946 """
947 return (
948 len(self.valid_buffer_layouts & other.valid_buffer_layouts) > 0
949 or len(self.valid_texture_layouts & other.valid_texture_layouts) > 0
950 )
951
952 def texture_is_valid(self):
953 return len(self.valid_texture_layouts) > 0

Calls

no outgoing calls

Tested by 2