Is there a corresponding function for TensorFlow’s squared_difference in PyTorch? or should I just create a function
def squared_difference(input, target):
    return (input - target) ** 2

to define it? For the sake of completeness:

tf.math.squared_difference: Returns (x - y)(x - y) element-wise.