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

Function _create_coordinate_tensor

monai/networks/blocks/crf.py:115–119  ·  view source on GitHub ↗
(tensor)

Source from the content-addressed store, hash-verified

113
114# helper methods
115def _create_coordinate_tensor(tensor):
116 axes = [torch.arange(tensor.size(i)) for i in range(2, tensor.dim())]
117 grids = meshgrid_ij(axes)
118 coords = torch.stack(grids).to(device=tensor.device, dtype=tensor.dtype)
119 return torch.stack(tensor.size(0) * [coords], dim=0)

Callers 1

forwardMethod · 0.85

Calls 1

meshgrid_ijFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…