def METHOD_NAME(self, outputs, labels):
    if type(outputs) != tuple and type(outputs) != list:
        outputs = [outputs]
    # reshape labels to match the output shape of the model
    if hasattr(outputs[0], 'shape'):
        labels = [label.reshape(output.shape)
                  if output.shape.numel() == label.shape.numel() else label
                  for label, output in zip(labels, outputs)]
    return outputs, labels