fix cross entropy loss send to device
This commit is contained in:
parent
e8e0060955
commit
472f3189c2
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ class CrossEntropyLoss(Loss):
|
|||
# target -> Ground truth class indices:
|
||||
num_classes = input.shape[1]
|
||||
|
||||
target = norch.one_hot_encode(target, num_classes)
|
||||
target = norch.one_hot_encode(target, num_classes).to(target.device)
|
||||
|
||||
batch_size = input.shape[0]
|
||||
logits = norch.softmax(input, dim=1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue