code: def __call__(self, x, sample_weight=None):
      self.sample_weight = sample_weight
      self._output_types = [
          OutputType.scalar if self.axis is None else OutputType.tensor
      ]
      dtype = np.dtype(int)
      inputs = [x]
      if sample_weight is not None:
          dtype = sample_weight.dtype
          inputs = [x, sample_weight]
  
      if self.axis is None:
          shape = ()
      else:
          shape = (x.shape[1 - self.axis],)
  
      return self.new_tileable(inputs, shape=shape, dtype=dtype)
  
file_path: mars/mars/learn/utils/sparsefuncs.py
imports: from typing import Optional
  import numpy
  from ...None import opcodes, tensor
  from ...core import OutputType, recursive_tile
  from ...serialization.serializables import Int16Field, ReferenceField
  from ...utils import has_unknown_shape
  from ..operands import LearnOperand, LearnOperandMixin
label_desc: Use image node_id 2 for calling the LearnCountNonzero obj's underlying member method code with example usage: obj.__call__(x, sample_weight) and returns: self