code: def gradient_loss(outputs, inputs):
      valid_mask = inputs[dataset_keys.VALID_MASK_IMG]
      gt_depth = inputs[dataset_keys.HIGH_RES_DEPTH_IMG]
      prediction = outputs[dataset_keys.PREDICTION_DEPTH_IMG]
  
      log_prediction = safe_torch_log(prediction)
      log_gt = safe_torch_log(gt_depth)
      loss = create_gradient_log_loss_4_scales(
          log_prediction, log_gt, valid_mask
      )
      loss = torch.mean(loss)
      return loss
  
file_path: ARKitScenes/depth_upsampling/losses/gradient_loss.py
imports: import torch
  import dataset_keys
label_desc: Use image node_id 4 for calling a global function with example usage: gradient_loss(outputs, inputs) and returns: loss