parameters: (node, **kwargs)
docstring: Map MXNet's mean operator attributes to onnx's ReduceMean operator
      and return the created node.
docstring_summary: Map MXNet's mean operator attributes to onnx's ReduceMean operator
      and return the created node.
docstring_tokens: Map MXNet s mean operator attributes to onnx s ReduceMean operator and return the created node .
function: def convert_mean(node, **kwargs):
      """Map MXNet's mean operator attributes to onnx's ReduceMean operator
      and return the created node.
      """
      from onnx.helper import make_node
      name, input_nodes, attrs = get_inputs(node, kwargs)
  
      mx_axis = str(attrs.get("axis", 'None'))
      axes = convert_string_to_list(mx_axis) if mx_axis != 'None' else None
  
      keepdims = get_boolean_attribute_value(attrs, "keepdims")
  
      if axes is not None:
          if keepdims:
              node = make_node('ReduceMean', input_nodes, [name], axes=axes, keepdims=keepdims)
              return [node]
          else:
              create_tensor([1], name+'_1', kwargs['initializer'])
              create_tensor([0], name+'_0', kwargs['initializer'])
              create_tensor([len(axes)], name+'_axes_dim', kwargs['initializer'])
              nodes = [
                  make_node('ReduceMean', input_nodes, [name+'_reduce'], axes=axes, keepdims=keepdims),
                  make_node('Shape', [name+'_reduce'], [name+'_reduce_shape']),
                  make_node('Shape', [name+'_reduce_shape'], [name+'_reduce_dim']),
                  make_node('Shape', [input_nodes[0]], [name+'_in_shape']),
                  make_node('Shape', [name+'_in_shape'], [name+'_in_dim']),
                  make_node('Equal', [name+'_axes_dim', name+'_in_dim'], [name+'_equal']),
                  make_node('Where', [name+'_equal', name+'_1', name+'_reduce_dim'], [name+'_where0']),
                  make_node('Tile', [name+'_0', name+'_where0'], [name+'_tile']),
                  make_node('Unsqueeze', [name+'_0', name+'_0'], [name+'_unsqueeze']),
                  make_node('Where', [name+'_equal', name+'_1', name+'_0'], [name+'_where1']),
                  make_node('ScatterND', [name+'_tile', name+'_unsqueeze', name+'_where1'], [name+'_SND']),
                  make_node('Reshape', [name+'_reduce', name+'_SND'], [name]),
              ]
              return nodes
      else:
          if keepdims:
              node = make_node('ReduceMean', input_nodes, [name], keepdims=keepdims)
              return [node]
  
          else:
              create_tensor([1], name+'_1', kwargs['initializer'])
              nodes = [
                  make_node('ReduceMean', input_nodes, [name+'_reduce'], keepdims=keepdims),
                  make_node('Reshape', [name+'_reduce', name+'_1'], [name])
              ]
              return nodes
function_tokens: def convert_mean ( node , * * kwargs ) : from onnx . helper import make_node name , input_nodes , attrs = get_inputs ( node , kwargs ) mx_axis = str ( attrs . get ( "axis" , 'None' ) ) axes = convert_string_to_list ( mx_axis ) if mx_axis != 'None' else None keepdims = get_boolean_attribute_value ( attrs , "keepdims" ) if axes is not None : if keepdims : node = make_node ( 'ReduceMean' , input_nodes , [ name ] , axes = axes , keepdims = keepdims ) return [ node ] else : create_tensor ( [ 1 ] , name + '_1' , kwargs [ 'initializer' ] ) create_tensor ( [ 0 ] , name + '_0' , kwargs [ 'initializer' ] ) create_tensor ( [ len ( axes ) ] , name + '_axes_dim' , kwargs [ 'initializer' ] ) nodes = [ make_node ( 'ReduceMean' , input_nodes , [ name + '_reduce' ] , axes = axes , keepdims = keepdims ) , make_node ( 'Shape' , [ name + '_reduce' ] , [ name + '_reduce_shape' ] ) , make_node ( 'Shape' , [ name + '_reduce_shape' ] , [ name + '_reduce_dim' ] ) , make_node ( 'Shape' , [ input_nodes [ 0 ] ] , [ name + '_in_shape' ] ) , make_node ( 'Shape' , [ name + '_in_shape' ] , [ name + '_in_dim' ] ) , make_node ( 'Equal' , [ name + '_axes_dim' , name + '_in_dim' ] , [ name + '_equal' ] ) , make_node ( 'Where' , [ name + '_equal' , name + '_1' , name + '_reduce_dim' ] , [ name + '_where0' ] ) , make_node ( 'Tile' , [ name + '_0' , name + '_where0' ] , [ name + '_tile' ] ) , make_node ( 'Unsqueeze' , [ name + '_0' , name + '_0' ] , [ name + '_unsqueeze' ] ) , make_node ( 'Where' , [ name + '_equal' , name + '_1' , name + '_0' ] , [ name + '_where1' ] ) , make_node ( 'ScatterND' , [ name + '_tile' , name + '_unsqueeze' , name + '_where1' ] , [ name + '_SND' ] ) , make_node ( 'Reshape' , [ name + '_reduce' , name + '_SND' ] , [ name ] ) , ] return nodes else : if keepdims : node = make_node ( 'ReduceMean' , input_nodes , [ name ] , keepdims = keepdims ) return [ node ] else : create_tensor ( [ 1 ] , name + '_1' , kwargs [ 'initializer' ] ) nodes = [ make_node ( 'ReduceMean' , input_nodes , [ name + '_reduce' ] , keepdims = keepdims ) , make_node ( 'Reshape' , [ name + '_reduce' , name + '_1' ] , [ name ] ) ] return nodes