code: def create_gradient_log_loss_4_scales(
      log_prediction, log_ground_truth, mask
  ):
      log_prediction_d = log_prediction
      log_gt = log_ground_truth
      mask = mask
  
      log_prediction_d_scale_1 = log_prediction_d[:, :, ::2, ::2]
      log_prediction_d_scale_2 = log_prediction_d_scale_1[
          :, :, ::2, ::2
      ]
      log_prediction_d_scale_3 = log_prediction_d_scale_2[
          :, :, ::2, ::2
      ]
  
      mask_scale_1 = mask[:, :, ::2, ::2]
      mask_scale_2 = mask_scale_1[:, :, ::2, ::2]
      mask_scale_3 = mask_scale_2[:, :, ::2, ::2]
  
      log_gt_scale_1 = log_gt[:, :, ::2, ::2]
      log_gt_scale_2 = log_gt_scale_1[:, :, ::2, ::2]
      log_gt_scale_3 = log_gt_scale_2[:, :, ::2, ::2]
  
      gradient_loss_scale_0 = create_gradient_log_loss(
          log_prediction_d, mask, log_gt
      )
  
      gradient_loss_scale_1 = create_gradient_log_loss(
          log_prediction_d_scale_1, mask_scale_1, log_gt_scale_1
      )
  
      gradient_loss_scale_2 = create_gradient_log_loss(
          log_prediction_d_scale_2, mask_scale_2, log_gt_scale_2
      )
  
      gradient_loss_scale_3 = create_gradient_log_loss(
          log_prediction_d_scale_3, mask_scale_3, log_gt_scale_3
      )
  
      gradient_loss_4_scales = (
          gradient_loss_scale_0
          + gradient_loss_scale_1
          + gradient_loss_scale_2
          + gradient_loss_scale_3
      )
  
      return gradient_loss_4_scales
  
file_path: ARKitScenes/depth_upsampling/losses/gradient_loss.py
imports: import torch
  import dataset_keys
label_desc: Use image node_id 3 for calling a global function with example usage: create_gradient_log_loss_4_scales(log_prediction, log_ground_truth, mask) and returns: gradient_loss_4_scales