| 41 | |
| 42 | @dataclass |
| 43 | class ArgDesc: |
| 44 | name: Union[str, int] |
| 45 | expandable_prefix: str |
| 46 | dest_device: str |
| 47 | layout: Optional[str] = None |
| 48 | |
| 49 | def __post_init__(self): |
| 50 | assert ( |
| 51 | self.is_positional_arg or self.dest_device != "gpu" |
| 52 | ), "Named arguments on GPU are not supported" |
| 53 | assert not self.layout or self.layout.startswith(self.expandable_prefix) |
| 54 | |
| 55 | @property |
| 56 | def is_positional_arg(self): |
| 57 | return isinstance(self.name, int) |
| 58 | |
| 59 | |
| 60 | class ArgCb: |
no outgoing calls