A "constrained" RepSet is one that has either: 1. A single valid texture memory layout, and no valid buffer memory layouts 2. No valid texture memory layouts, and a single valid buffer memory layout 3. Is empty In this case, it is unambiguous which represent
(self)
| 985 | return TensorRepr(VkStorageType.BUFFER, self.first_valid_buffer_layout()) |
| 986 | |
| 987 | def is_constrained(self) -> bool: |
| 988 | """ |
| 989 | A "constrained" RepSet is one that has either: |
| 990 | 1. A single valid texture memory layout, and no valid buffer memory layouts |
| 991 | 2. No valid texture memory layouts, and a single valid buffer memory layout |
| 992 | 3. Is empty |
| 993 | |
| 994 | In this case, it is unambiguous which representation should be used for the |
| 995 | tensor. |
| 996 | """ |
| 997 | if self.is_empty(): |
| 998 | return True |
| 999 | elif ( |
| 1000 | len(self.valid_texture_layouts) == 1 and len(self.valid_buffer_layouts) == 0 |
| 1001 | ): |
| 1002 | return True |
| 1003 | elif ( |
| 1004 | len(self.valid_texture_layouts) == 0 and len(self.valid_buffer_layouts) == 1 |
| 1005 | ): |
| 1006 | return True |
| 1007 | else: |
| 1008 | return False |
| 1009 | |
| 1010 | def is_ambiguous(self) -> bool: |
| 1011 | """ |