MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / randomize

Method randomize

monai/transforms/spatial/array.py:1989–1991  ·  view source on GitHub ↗
(self, grid_size: Sequence[int])

Source from the content-addressed store, hash-verified

1987 self.device = device
1988
1989 def randomize(self, grid_size: Sequence[int]) -> None:
1990 self.random_offset = self.R.normal(size=([len(grid_size)] + list(grid_size))).astype(np.float32, copy=False)
1991 self.rand_mag = self.R.uniform(self.magnitude[0], self.magnitude[1])
1992
1993 def __call__(self, spatial_size: Sequence[int]) -> torch.Tensor:
1994 """

Callers 1

__call__Method · 0.95

Calls 1

astypeMethod · 0.80

Tested by

no test coverage detected