code: def _count_cell_flops(self, input_size, hidden_size, cell_type):
      # h' = \tanh(W_{ih} x + b_{ih}  +  W_{hh} h + b_{hh})
      total_ops = hidden_size * (input_size + hidden_size) + hidden_size
  
      if self._count_bias:
          total_ops += hidden_size * 2
  
      if cell_type == "rnn":
          return total_ops
  
      if cell_type == "gru":
          # r = \sigma(W_{ir} x + b_{ir} + W_{hr} h + b_{hr}) \\
          # z = \sigma(W_{iz} x + b_{iz} + W_{hz} h + b_{hz}) \\
          # n = \tanh(W_{in} x + b_{in} + r * (W_{hn} h + b_{hn})) \\
          total_ops *= 3
  
          # r hadamard : r * (~)
          total_ops += hidden_size
  
          # h' = (1 - z) * n + z * h
          # hadamard hadamard add
          total_ops += hidden_size * 3
  
      elif cell_type == "lstm":
          # i = \sigma(W_{ii} x + b_{ii} + W_{hi} h + b_{hi}) \\
          # f = \sigma(W_{if} x + b_{if} + W_{hf} h + b_{hf}) \\
          # o = \sigma(W_{io} x + b_{io} + W_{ho} h + b_{ho}) \\
          # g = \tanh(W_{ig} x + b_{ig} + W_{hg} h + b_{hg}) \\
          total_ops *= 4
  
          # c' = f * c + i * g
          # hadamard hadamard add
          total_ops += hidden_size * 3
  
          # h' = o * \tanh(c')
          total_ops += hidden_size
  
      return total_ops
  
imports: import functools
  from collections import Counter
  from prettytable import PrettyTable
  import torch
  import torch.nn
  from torch.nn.utils.rnn import PackedSequence
  from nni.compression.base.wrapper import ModuleWrapper
label_desc: Use image node_id 11 for calling the ModelProfiler obj's underlying member method code with example usage: obj._count_cell_flops(input_size, hidden_size, cell_type) and returns: total_ops, total_ops