code: def _to_tensor(self):
      assert (
          len(self.model_inputs) == 1
      ), "AveragePool accept single input only"
      rank = len(self.model_inputs[0].zvalue.shape)
      if rank == 4:  # NCHW
          poolSize = [int(i) for i in self.onnx_attr["kernel_shape"]]
          strides = [int(i) for i in self.onnx_attr["strides"]]
          count_include_pad = (
              bool(self.onnx_attr["count_include_pad"])
              if "count_include_pad" in self.onnx_attr
              else False
          )
          dim_ordering = "th"
          border_mode, pads = OnnxHelper.get_padds(self.onnx_attr)
          averagepool2d = zlayers.AveragePooling2D(
              pool_size=poolSize,
              strides=strides,
              dim_ordering=dim_ordering,
              pads=pads,
              count_include_pad=count_include_pad,
          )
          return averagepool2d(self.model_inputs[0].zvalue)
      else:
          raise Exception("not supported.")
  
imports: from zoo.pipeline.api.onnx.mapper.operator_mapper import OperatorMapper
  from zoo.pipeline.api.onnx.onnx_helper import OnnxHelper
  import zoo.pipeline.api.keras.layers
label_desc: Use image node_id 2 for calling the AveragePoolMapper obj's underlying member method code with example usage: obj._to_tensor() and returns: averagepool2d