import torch


def compute_distance(U, V):
  """Compute Euclidean distance between two field tensors

  Args:
    U: torch tensor for field
    V: torch tensor for field

  Returns:
    torch tensor (image format) with distance between U, V
  """
  D = U - V
  N = pow(D, 2)
  return pow(torch.sum(N, 3), 0.5).unsqueeze(0)