Args: img: channel first array, must have shape: (num_channels, H[, W, ..., ]), randomize: whether to execute `randomize()` function first, default to True. lazy: a flag to indicate whether this transform should execute lazily or not durin
(self, img: torch.Tensor, randomize: bool = True, lazy: bool | None = None)
| 1465 | self._lazy = val |
| 1466 | |
| 1467 | def __call__(self, img: torch.Tensor, randomize: bool = True, lazy: bool | None = None) -> torch.Tensor: |
| 1468 | """ |
| 1469 | Args: |
| 1470 | img: channel first array, must have shape: (num_channels, H[, W, ..., ]), |
| 1471 | randomize: whether to execute `randomize()` function first, default to True. |
| 1472 | lazy: a flag to indicate whether this transform should execute lazily or not |
| 1473 | during this call. Setting this to False or True overrides the ``lazy`` flag set |
| 1474 | during initialization for this call. Defaults to None. |
| 1475 | """ |
| 1476 | if randomize: |
| 1477 | self.randomize(None) |
| 1478 | lazy_ = self.lazy if lazy is None else lazy |
| 1479 | out = self.flipper(img, lazy=lazy_) if self._do_transform else img |
| 1480 | out = convert_to_tensor(out, track_meta=get_track_meta()) |
| 1481 | self.push_transform(out, replace=True, lazy=lazy_) |
| 1482 | return out |
| 1483 | |
| 1484 | def inverse(self, data: torch.Tensor) -> torch.Tensor: |
| 1485 | transform = self.pop_transform(data) |
nothing calls this directly
no test coverage detected