code: def _get_rnn_gates(op_type):
      num_gates = 1
      if op_type == "lstm":
          num_gates = 4
      elif op_type == "gru":
          # NOTE that cudnn GRU implementation is different from standard one
          # that cell got projection/bias as well before element_times
          # from CUDNN doc watch out for the difference in h't calculation:
          #
          # it = sigmoid(Wixt + Riht-1 + bWi + bRu)
          # rt = sigmoid(Wrxt + Rrht-1 + bWr + bRr)
          # h't = tanh(Whxt + rt.*(Rhht-1 + bRh) + bWh)
          # ht = (1 - it) .* h't + it .* ht-1
          #
          # so to convert cudnn to CPU we need a different GRU
          num_gates = 3
      else:
          raise NotImplementedError()
      return num_gates
  
imports: import cntk
  import numpy
  from cntk.contrib import crosstalk
label_desc: Use image node_id 10 for calling a global function with example usage: _get_rnn_gates(op_type) and returns: num_gates