code: def _conv_trans_flops_compute(
      input,
      weight,
      bias=None,
      stride=1,
      padding=0,
      output_padding=0,
      groups=1,
      dilation=1,
  ):
      batch_size = input.shape[0]
      in_channels = input.shape[1]
      out_channels = weight.shape[0]
      kernel_dims = list(weight.shape[2:])
      input_dims = list(input.shape[2:])
  
      length = len(input_dims)
  
      paddings = (
          padding if type(padding) is tuple else (padding,) * length
      )
      strides = stride if type(stride) is tuple else (stride,) * length
      dilations = (
          dilation if type(dilation) is tuple else (dilation,) * length
      )
  
      output_dims = []
      for idx, input_dim in enumerate(input_dims):
          output_dim = (
              input_dim
              + 2 * paddings[idx]
              - (dilations[idx] * (kernel_dims[idx] - 1) + 1)
          ) // strides[idx] + 1
          output_dims.append(output_dim)
  
      paddings = (
          padding if type(padding) is tuple else (padding, padding)
      )
      strides = stride if type(stride) is tuple else (stride, stride)
      dilations = (
          dilation if type(dilation) is tuple else (dilation, dilation)
      )
  
      filters_per_channel = out_channels // groups
      conv_per_position_macs = (
          int(_prod(kernel_dims)) * in_channels * filters_per_channel
      )
      active_elements_count = batch_size * int(_prod(input_dims))
      overall_conv_macs = conv_per_position_macs * active_elements_count
      overall_conv_flops = 2 * overall_conv_macs
  
      bias_flops = 0
      if bias is not None:
          bias_flops = (
              out_channels * batch_size * int(_prod(output_dims))
          )
  
      return int(overall_conv_flops + bias_flops), int(
          overall_conv_macs
      )
  
imports: import time
  import torch
  import torch.nn
  import torch.nn.functional
  from functools import partial
  from typing import List, Optional
  from collections import OrderedDict
  import numpy
label_desc: Use image node_id 12 for calling a global function with example usage: _conv_trans_flops_compute(input, weight, bias, stride, padding, output_padding, groups, dilation) and returns: int,  int