Args: img: channel first array, must have shape: (num_channels, H[, W, ..., ]) lazy: a flag to indicate whether this transform should execute lazily or not during this call. Setting this to False or True overrides the ``lazy`` flag set
(self, img: torch.Tensor, lazy: bool | None = None)
| 730 | self.spatial_axis = spatial_axis |
| 731 | |
| 732 | def __call__(self, img: torch.Tensor, lazy: bool | None = None) -> torch.Tensor: |
| 733 | """ |
| 734 | Args: |
| 735 | img: channel first array, must have shape: (num_channels, H[, W, ..., ]) |
| 736 | lazy: a flag to indicate whether this transform should execute lazily or not |
| 737 | during this call. Setting this to False or True overrides the ``lazy`` flag set |
| 738 | during initialization for this call. Defaults to None. |
| 739 | """ |
| 740 | img = convert_to_tensor(img, track_meta=get_track_meta()) |
| 741 | lazy_ = self.lazy if lazy is None else lazy |
| 742 | return flip(img, self.spatial_axis, lazy=lazy_, transform_info=self.get_transform_info()) # type: ignore |
| 743 | |
| 744 | def inverse(self, data: torch.Tensor) -> torch.Tensor: |
| 745 | self.pop_transform(data) |
no test coverage detected