code: def one_hot_3_axes(input, axis):
      total_axes = len(input[0].shape)
      assert total_axes == 3
      axis = axis if axis >= 0 else total_axes
      shapes = []
      results = []
      for i in range(batch_size):
          shape = insert_as_axis(
              input[i].shape, num_classes, axis, total_axes
          )
          result = np.zeros(shape, dtype=np.int32)
          shapes.append(shape)
          for i0 in range(input[i].shape[0]):
              for i1 in range(input[i].shape[1]):
                  for i2 in range(input[i].shape[2]):
                      in_coord = (i0, i1, i2)
                      out_coord = insert_as_axis(
                          in_coord, input[i][in_coord], axis, total_axes
                      )
                      result[out_coord] = 1
          results.append(result)
      return results
  
imports: from functools import partial
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import nvidia.dali.types
  from test_utils import check_batch
  from nose_utils import raises
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: one_hot_3_axes(input, axis) and returns: results