Загрузка
Returns the indices of the buckets to which each value in the input belongs, where the
boundaries of the buckets are set by boundaries. Return a new tensor with the same size
as input. If right is False (default), then the left boundary is open. Note that
this behavior is opposite the behavior of
numpy.digitize.
More formally, the returned index satisfies the following rules:
| returned index satisfies |
|---|---|
False |
|
True |
|
Example:
>>> boundaries = torch.tensor([1, 3, 5, 7, 9])
>>> boundaries
tensor([1, 3, 5, 7, 9])
>>> v = torch.tensor([[3, 6, 9], [3,
out (Tensor, optional) – the output tensor, must be the same size as input if provided.