class_docstr: Currently we only use it to infer caffe shape, we use tensorflow engine
  to infer tensorflow op shapes, since tensorflow has too many ops.
class_docstr_tok: ["Currently","we","only","use","it","to","infer","caffe","shape",",","we","use","tensorflow","engine","to","infer","tensorflow","op","shapes",",","since","tensorflow","has","too","many","ops","."]
code: def infer_shape_deconv(self, op):
      input_shape = self._output_shape_cache[op.input[0]]
      output_shape = np.zeros_like(input_shape)
      filter_shape = self._output_shape_cache[op.input[1]]
  
      paddings = ConverterUtil.get_arg(
          op, MaceKeyword.mace_padding_values_str
      ).ints  # noqa
      strides = ConverterUtil.get_arg(
          op, MaceKeyword.mace_strides_str
      ).ints
      dilations_arg = ConverterUtil.get_arg(
          op, MaceKeyword.mace_dilations_str
      )
      if dilations_arg is not None:
          dilations = dilations_arg.ints
      else:
          dilations = [1, 1]
      round_func = math.floor
  
      group_arg = ConverterUtil.get_arg(op, MaceKeyword.mace_group_str)
      output_shape[0] = input_shape[0]
      if (
          ConverterUtil.data_format(op) == DataFormat.NCHW
          and ConverterUtil.filter_format(self._net) == DataFormat.OIHW
      ):
          # filter format: IOHW
          output_shape[1] = filter_shape[1]
          if group_arg is not None and group_arg.i > 1:
              output_shape[1] = group_arg.i * filter_shape[1]
          output_shape[2] = int(
              round_func(
                  (input_shape[2] - 1) * strides[0]
                  + (filter_shape[2] - 1) * (dilations[0] - 1)
                  + filter_shape[2]
                  - paddings[0]
              )
          )
          output_shape[3] = int(
              round_func(
                  (input_shape[3] - 1) * strides[1]
                  + (filter_shape[3] - 1) * (dilations[1] - 1)
                  + filter_shape[3]
                  - paddings[1]
              )
          )
      else:
          mace_check(
              False,
              "Mace can only infer shape for"
              " NCHW input and OIHW filter",
          )
      print(
          "deconv layer %s (%s) input:%s filter:%s output:%s"
          % (op.name, op.type, input_shape, filter_shape, output_shape)
      )
  
      self.add_output_shape(op, [output_shape])
  
imports: import math
  import numpy
  import six
  from transform.transformer import Transformer
  from transform.base_converter import DataFormat
  from transform.base_converter import MaceOp
  from transform.base_converter import MaceKeyword
  from transform.base_converter import ConverterUtil
  from utils.util import mace_check
label_desc: Use image node_id 6 for calling the ShapeInference obj's underlying member method code with example usage: obj.infer_shape_deconv(op) without return types