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

Method split

torch/_tensor.py:881–896  ·  view source on GitHub ↗

r"""See :func:`torch.split`

(self, split_size, dim=0)

Source from the content-addressed store, hash-verified

879 return Resize.apply(self, tensor.size())
880
881 def split(self, split_size, dim=0):
882 r"""See :func:`torch.split`"""
883 if has_torch_function_unary(self):
884 return handle_torch_function(
885 Tensor.split, (self,), self, split_size, dim=dim
886 )
887 if isinstance(split_size, Tensor):
888 try:
889 split_size = int(split_size)
890 except ValueError:
891 pass
892
893 if isinstance(split_size, (int, torch.SymInt)):
894 return torch._VF.split(self, split_size, dim) # type: ignore[attr-defined]
895 else:
896 return torch._VF.split_with_sizes(self, split_size, dim)
897
898 def unique(self, sorted=True, return_inverse=False, return_counts=False, dim=None):
899 r"""Returns the unique elements of the input tensor.

Callers 15

get_submodule_foldersFunction · 0.45
_embed_libiompMethod · 0.45
runMethod · 0.45
runMethod · 0.45
print_boxFunction · 0.45
registrationsMethod · 0.45
dispatchTableMethod · 0.45
parse_kwargsFunction · 0.45
registerFunction · 0.45
_get_device_from_moduleFunction · 0.45
normalize_source_linesFunction · 0.45

Calls 2

handle_torch_functionFunction · 0.90
isinstanceFunction · 0.85

Tested by 15

get_disabled_issuesFunction · 0.36
get_oncall_from_testfileFunction · 0.36
get_disabled_test_nameFunction · 0.36
test_impact_of_fileFunction · 0.36
__init__Method · 0.36
overload_to_aten_nameFunction · 0.36
all_aten_overloadsMethod · 0.36
test_splitMethod · 0.36