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

Method torch_unique

test/test_jit.py:9164–9170  ·  view source on GitHub ↗
(dim: Optional[int])

Source from the content-addressed store, hash-verified

9162 self.checkScript(norm, ())
9163
9164 def torch_unique(dim: Optional[int]):
9165 ten = torch.unique(torch.tensor([[1, 3], [2, 3]], dtype=torch.long))
9166 a = torch.unique(ten, dim=dim)
9167 b = torch.unique(ten, return_counts=True, dim=dim)
9168 c = torch.unique(ten, return_inverse=True, dim=dim)
9169 d = torch.unique(ten, return_counts=True, return_inverse=True, dim=dim)
9170 return a, b, c, d
9171
9172 self.checkScript(torch_unique, (None,))
9173 self.checkScript(torch_unique, (0,))

Callers

nothing calls this directly

Calls 2

uniqueMethod · 0.80
tensorMethod · 0.45

Tested by

no test coverage detected