See :class:`~torch.nn.SmoothL1Loss` for details.
"""
+ if not (target.size() == input.size()):
+ warnings.warn("Using a target size ({}) that is different to the input size ({}). "
+ "This will likely lead to incorrect results due to broadcasting. "
+ "Please ensure they have the same size.".format(target.size(), input.size()),
+ stacklevel=2)
if size_average is not None or reduce is not None:
reduction = _Reduction.legacy_get_string(size_average, reduce)
if target.requires_grad:
See :class:`~torch.nn.L1Loss` for details.
"""
+ if not (target.size() == input.size()):
+ warnings.warn("Using a target size ({}) that is different to the input size ({}). "
+ "This will likely lead to incorrect results due to broadcasting. "
+ "Please ensure they have the same size.".format(target.size(), input.size()),
+ stacklevel=2)
if size_average is not None or reduce is not None:
reduction = _Reduction.legacy_get_string(size_average, reduce)
if target.requires_grad: