This class is a wrapper around a pair of VkStorageType and VkMemoryLayout which describes how a tensor should be represented in the Vulkan Delegate.
| 782 | |
| 783 | |
| 784 | class 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 | |
| 809 | class TensorReprList: |
no outgoing calls