MCPcopy Create free account
hub / github.com/pytorch/pytorch / dsplit

Function dsplit

torch/_refs/__init__.py:4329–4339  ·  view source on GitHub ↗
(a: TensorLikeType, sections: DimsType)

Source from the content-addressed store, hash-verified

4327
4328# CompositeImplicitAutograd - don't register decomp
4329def dsplit(a: TensorLikeType, sections: DimsType) -> TensorSequenceType:
4330 if a.ndim < 3:
4331 raise RuntimeError(
4332 f"torch.dsplit requires a tensor with at least 3 dimension, but got a tensor with {a.ndim} dimensions!"
4333 )
4334 if isinstance(sections, IntLike) and (sections == 0 or a.shape[2] % sections != 0):
4335 raise RuntimeError(
4336 "torch.dsplit attempted to split along dimension 2, "
4337 + f"but the size of the dimension {a.shape[2]} is not divisible by the split_size {sections}!"
4338 )
4339 return tensor_split(a, sections, 2)
4340
4341
4342@register_decomposition(aten.t.default)

Callers

nothing calls this directly

Calls 2

isinstanceFunction · 0.85
tensor_splitFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…