find MetaTensors in list or dict `data` and (in-place) set ``TraceKeys.ID`` to ``Tracekeys.NONE``.
(data)
| 1803 | |
| 1804 | |
| 1805 | def reset_ops_id(data): |
| 1806 | """find MetaTensors in list or dict `data` and (in-place) set ``TraceKeys.ID`` to ``Tracekeys.NONE``.""" |
| 1807 | if isinstance(data, (list, tuple)): |
| 1808 | return [reset_ops_id(d) for d in data] |
| 1809 | if isinstance(data, monai.data.MetaTensor): |
| 1810 | data.applied_operations = reset_ops_id(data.applied_operations) |
| 1811 | return data |
| 1812 | if not isinstance(data, Mapping): |
| 1813 | return data |
| 1814 | data = dict(data) |
| 1815 | if TraceKeys.ID in data: |
| 1816 | data[TraceKeys.ID] = TraceKeys.NONE |
| 1817 | return {k: reset_ops_id(v) for k, v in data.items()} |
| 1818 | |
| 1819 | |
| 1820 | def compute_divisible_spatial_size(spatial_shape: Sequence[int], k: Sequence[int] | int): |
no outgoing calls
searching dependent graphs…