Skip to content

Commit b3ca3da

Browse files
authored
fix type mismatch
1 parent f484a5f commit b3ca3da

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
@@ -766,7 +766,7 @@ def binary_cross_entropy(input, target, weight=None, size_average=True):
766766
sizeAverage is set to False, the losses are instead summed
767767
for each minibatch. Default: True
768768
"""
769-
if not target.is_same_size(input):
769+
if not (target.size() == input.size()):
770770
warnings.warn("Using a target size ({}) that is different to the input size ({}) is deprecated. "
771771
"Please ensure they have the same size.".format(target.size(), input.size()))
772772
if input.nelement() != target.nelement():

0 commit comments

Comments
 (0)