code: def execute_agg(cls, ctx, op):
      axis = cls.get_axis(op.axis)
  
      a = ctx[op.inputs[0].key]
      if not isinstance(a, (list, tuple)):
          (inp,), device_id, xp = as_same_device(
              [a], device=op.device, ret_extra=True
          )
  
          with device(device_id):
              ctx[op.outputs[0].key] = xp.nanmean(
                  inp,
                  axis=axis,
                  dtype=op.dtype,
                  keepdims=bool(op.keepdims),
              )
      else:
          (_data, _count), device_id, xp = as_same_device(
              a, device=op.device, ret_extra=True
          )
  
          with device(device_id):
              chunk_count = xp.sum(
                  _count,
                  axis=axis,
                  dtype=op.dtype,
                  keepdims=bool(op.keepdims),
              )
              chunk_sum = xp.sum(
                  _data,
                  axis=axis,
                  dtype=op.dtype,
                  keepdims=bool(op.keepdims),
              )
              ctx[op.outputs[0].key] = xp.true_divide(
                  chunk_sum, chunk_count, dtype=op.dtype
              )
  
file_path: mars/mars/tensor/reduction/nanmean.py
imports: import numpy
  from ...None import opcodes
  from ..datasource import tensor
  from ..array_utils import as_same_device, device
  from .core import TensorReduction, TensorReductionMixin, nannumel
  from .mean import TensorMean
label_desc: Use image node_id 3 for calling the TensorNanMean obj's underlying member method code with example usage: obj.execute_agg(cls, ctx, op) without return types