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

Function concatenate

monai/transforms/utils_pytorch_numpy_unification.py:312–316  ·  view source on GitHub ↗

`np.concatenate` with equivalent implementation for torch (`torch.cat`).

(to_cat: Sequence[NdarrayOrTensor], axis: int = 0, out=None)

Source from the content-addressed store, hash-verified

310
311
312def concatenate(to_cat: Sequence[NdarrayOrTensor], axis: int = 0, out=None) -> NdarrayOrTensor:
313 """`np.concatenate` with equivalent implementation for torch (`torch.cat`)."""
314 if isinstance(to_cat[0], np.ndarray):
315 return np.concatenate(to_cat, axis, out) # type: ignore
316 return torch.cat(to_cat, dim=axis, out=out) # type: ignore
317
318
319def cumsum(a: NdarrayOrTensor, axis=None, **kwargs) -> NdarrayOrTensor:

Callers 7

get_target_spacingMethod · 0.90
apply_affine_to_pointsFunction · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
convert_box_to_pointsFunction · 0.90
convert_points_to_boxFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…