Skip to content

Commit 42328b7

Browse files
authored
fix another is_same_size call
1 parent ca98c65 commit 42328b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/nn/functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ def binary_cross_entropy_with_logits(input, target, weight=None, size_average=Tr
796796
sizeAverage is set to False, the losses are instead summed
797797
for each minibatch. Default: True
798798
"""
799-
if not target.is_same_size(input):
799+
if not (target.size() == input.size()):
800800
raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size()))
801801

802802
max_val = (-input).clamp(min=0)

0 commit comments

Comments
 (0)