code: def restore_missing_value_zeros(tensor, weights):
      n_dimensions = weights.ndim
      entire_tensor = [slice(None)] * n_dimensions
      lower = []
      higher = []
      for dimension_idx in range(n_dimensions):
          dim_slices = entire_tensor.copy()
          dim_slices[dimension_idx] = 0
          total_sum = np.sum(weights[tuple(dim_slices)])
          lower.append(True if total_sum == 0 else False)
          dim_slices[dimension_idx] = -1
          total_sum = np.sum(weights[tuple(dim_slices)])
          higher.append(True if total_sum == 0 else False)
      _zero_tensor(tensor, lower, higher)
  
imports: from itertools import count
  import numpy
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: restore_missing_value_zeros(tensor, weights) without return types