code: def choose_act(self, name, alpha, beta):  # type: ignore
      if name in ("Tanh", "tanh"):
          return self._f_tanh
      if name in ("Affine", "affine"):
          return lambda x: x * alpha + beta
      raise RuntimeError(f"Unknown activation function {name!r}.")
  
file_path: onnx/onnx/reference/ops/op_rnn.py
imports: import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 2 for calling the CommonRNN obj's underlying member method code with example usage: obj.choose_act(name, alpha, beta) and returns: self, function