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

Class TensorRepr

backends/vulkan/utils.py:784–806  ·  view source on GitHub ↗

This class is a wrapper around a pair of VkStorageType and VkMemoryLayout which describes how a tensor should be represented in the Vulkan Delegate.

Source from the content-addressed store, hash-verified

782
783
784class TensorRepr:
785 """
786 This class is a wrapper around a pair of VkStorageType and VkMemoryLayout which
787 describes how a tensor should be represented in the Vulkan Delegate.
788 """
789
790 def __init__(self, storage_type: VkStorageType, memory_layout: VkMemoryLayout):
791 self.storage_type = storage_type
792 self.memory_layout = memory_layout
793
794 def __str__(self) -> str:
795 return f"TensorRepr({self.storage_type}, {self.memory_layout})"
796
797 def __eq__(self, other: object) -> bool:
798 if not isinstance(other, TensorRepr):
799 return NotImplemented
800 return (
801 self.storage_type == other.storage_type
802 and self.memory_layout == other.memory_layout
803 )
804
805 def __ne__(self, other: object) -> bool:
806 return not self.__eq__(other)
807
808
809class TensorReprList:

Calls

no outgoing calls