mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE][2/16] fix typos in torch/ (torch/_*/) (#156312)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/156312 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
8b97e4dd8c
commit
7a92b51196
@ -6077,7 +6077,7 @@ def bucketize(
|
||||
if n_boundaries == 0:
|
||||
return torch.zeros_like(a)
|
||||
# We are trying to find the bucket (defined by pairs of consecutive elements of `boundaries`)
|
||||
# each element of `a` belongs to. We use binary search to achieve logarithimic complexity,
|
||||
# each element of `a` belongs to. We use binary search to achieve logarithmic complexity,
|
||||
# but each step of the search is done "in parallel" over all elements of `a`
|
||||
# can't use int32 as indexes, so we have to do all computations with int64 and convert at the end
|
||||
start = torch.zeros(a.shape, device=a.device, dtype=torch.int64)
|
||||
|
@ -760,7 +760,7 @@ def _nll_loss_nd(
|
||||
batch_size = input.shape[0]
|
||||
loss = -input[torch.arange(batch_size), target] * current_weight
|
||||
else:
|
||||
# 3D case (N batch size, C classe, K dimensions)
|
||||
# 3D case (N batch size, C classes, K dimensions)
|
||||
# input (N batch size, C classes, K)
|
||||
batch_size = input.shape[0]
|
||||
extent = input.shape[2]
|
||||
|
Reference in New Issue
Block a user