code: def type_inference(self):
      x_type = self.x.dtype
      x_shape = self.x.shape
      axis = self.axis.val
  
      reduced_shape = list(x_shape)
      axis = axis if axis >= 0 else axis + len(reduced_shape)
      if self.keep_dims.val:
          reduced_shape[axis] = 1
      else:
          reduced_shape.pop(axis)
  
      return types.tensor(x_type, tuple(reduced_shape))
  
imports: import scipy
  from ._op_reqs import *
label_desc: Use image node_id 2 for calling the ReductionAxis obj's underlying member method code with example usage: obj.type_inference() and returns: types