Return a copy of this call with selected fields replaced. Every field that is not overridden in ``changes`` is preserved from ``self`` (including ``scope``), so rebuilds never silently drop fields. The returned node is downcast to the registered subclass for ``op``.
(self, **changes: Any)
| 1003 | return new_instance |
| 1004 | |
| 1005 | def replace(self, **changes: Any) -> "TilePrimitiveCall": |
| 1006 | """Return a copy of this call with selected fields replaced. |
| 1007 | |
| 1008 | Every field that is not overridden in ``changes`` is preserved from |
| 1009 | ``self`` (including ``scope``), so rebuilds never silently drop fields. |
| 1010 | The returned node is downcast to the registered subclass for ``op``. |
| 1011 | |
| 1012 | Parameters |
| 1013 | ---------- |
| 1014 | **changes : Any |
| 1015 | Field overrides; any of ``op``, ``args``, ``workspace``, ``config``, |
| 1016 | ``dispatch``, ``scope``. |
| 1017 | |
| 1018 | Returns |
| 1019 | ------- |
| 1020 | new_call : TilePrimitiveCall |
| 1021 | A new call with the requested fields replaced. |
| 1022 | """ |
| 1023 | unknown = set(changes) - {"op", "args", "workspace", "config", "dispatch", "scope"} |
| 1024 | if unknown: |
| 1025 | raise TypeError(f"Unknown field(s) for TilePrimitiveCall.replace: {sorted(unknown)}") |
| 1026 | new_call = TilePrimitiveCall( |
| 1027 | *changes.get("args", self.args), |
| 1028 | op=changes.get("op", self.op), |
| 1029 | workspace=changes.get("workspace", self.workspace), |
| 1030 | config=changes.get("config", self.config), |
| 1031 | dispatch=changes.get("dispatch", self.dispatch), |
| 1032 | scope=changes.get("scope", self.scope), |
| 1033 | ) |
| 1034 | return TilePrimitiveCall.downcast(new_call) |
| 1035 | |
| 1036 | def with_workspace(self, workspace: dict[str, Buffer]) -> "TilePrimitiveCall": |
| 1037 | """Return a copy with ``workspace`` replaced, preserving all other fields.""" |