class_docstr: Recurrent Neural Network (RNN)
  
  .. math::
     h_t = \rm{activation}(W_{ih} x_t + b_{ih} + W_{hh} h_{t−1} + b_{hh})
  
  Where:
  
  * :math:`W_{ih}` is the input weight.
  * :math:`W_{hh}` is the hidden/recurrent weight.
  * :math:`h_t`  is the hidden state at time ``t``.
  * :math:`x_t` is the input at time ``t``.
  * :math:`h_{t-1}` is the hidden state of the layer at time ``t-1`` or the initial
    hidden state at ``t = 0``.
  * :math:`b_{ih}` is the input bias.
  * :math:`b_{hh}` if the hidden/recurrent bias.
  
  Parameters
  ----------
  x: <s, b, I, T> (Required)
      * ``s`` is the sequence length, ``b`` is the batch size, and ``I`` is the
        input dimension.
  
  initial_h: <b, H, T> (Required)
      * ``H`` denotes hidden size.
  
  weight_ih: const<H, I, T> (Required) - Input-hidden weight matrix
  
  weight_hh: const<H, H, T> (Required) - Hidden-hidden weight matrix
  
  bias: const<H, T> (Optional) [Default all 0s]
      * bias for input-hidden and hidden-hidden
  
  direction: const<str> (Optional) [Default=forward]
      * Either ``forward`` or ``reverse``.
  
  output_sequence: const<bool> (Optional) [Default=False]
      * Outputs every step if ``True``.
  
  activation: const<str> (Optional) [Default=tanh]
      * Supported activation functions: ``relu``, ``tanh``, ``sigmoid``,
        ``sigmoid_hard``, ``scaled_tanh``, and ``linear``.
  
  Returns
  -------
  <s, b, H, T> or <1, b, H, T>
      * If ``output_sequence == True`` (hidden states from every step):
        ``<s, b, H, T>``.
      * Else ``<1, b, H, T>`` (hidden states of the final step).
  <b, H, T>
      * Hidden states of the final step.
  
  Attributes
  ----------
  T: fp32
class_docstr_tok: ["Recurrent","Neural","Network","(","RNN",")","..","math",":",":","h_t","=","\\rm","{","activation","}","(","W_","{","ih","}","x_t","+","b_","{","ih","}","+","W_","{","hh","}","h_","{","t\u22121","}","+","b_","{","hh","}",")","Where",":","*",":","math",":","`","W_","{","ih","}","`","is","the","input","weight",".","*",":","math",":","`","W_","{","hh","}","`","is","the","hidden\/recurrent","weight",".","*",":","math",":","`","h_t","`","is","the","hidden","state","at","time","``","t","``",".","*",":","math",":","`","x_t","`","is","the","input","at","time","``","t","``",".","*",":","math",":","`","h_","{","t-1","}","`","is","the","hidden","state","of","the","layer","at","time","``","t-1","``","or","the","initial","hidden","state","at","``","t","=","0","``",".","*",":","math",":","`","b_","{","ih","}","`","is","the","input","bias",".","*",":","math",":","`","b_","{","hh","}","`","if","the","hidden\/recurrent","bias",".","Parameters","--","--","--","--","--","x",":","<","s",",","b",",","I",",","T",">","(","Required",")","*","``","s","``","is","the","sequence","length",",","``","b","``","is","the","batch","size",",","and","``","I","``","is","the","input","dimension",".","initial_h",":","<","b",",","H",",","T",">","(","Required",")","*","``","H","``","denotes","hidden","size",".","weight_ih",":","const","<","H",",","I",",","T",">","(","Required",")","-","Input-hidden","weight","matrix","weight_hh",":","const","<","H",",","H",",","T",">","(","Required",")","-","Hidden-hidden","weight","matrix","bias",":","const","<","H",",","T",">","(","Optional",")","[","Default","all","0s","]","*","bias","for","input-hidden","and","hidden-hidden","direction",":","const","<","str",">","(","Optional",")","[","Default=forward","]","*","Either","``","forward","``","or","``","reverse","``",".","output_sequence",":","const","<","bool",">","(","Optional",")","[","Default=False","]","*","Outputs","every","step","if","``","True","``",".","activation",":","const","<","str",">","(","Optional",")","[","Default=tanh","]","*","Supported","activation","functions",":","``","relu","``",",","``","tanh","``",",","``","sigmoid","``",",","``","sigmoid_hard","``",",","``","scaled_tanh","``",",","and","``","linear","``",".","Returns","--","--","--","-","<","s",",","b",",","H",",","T",">","or","<","1",",","b",",","H",",","T",">","*","If","``","output_sequence","==","True","``","(","hidden","states","from","every","step",")",":","``","<","s",",","b",",","H",",","T",">","``",".","*","Else","``","<","1",",","b",",","H",",","T",">","``","(","hidden","states","of","the","final","step",")",".","<","b",",","H",",","T",">","*","Hidden","states","of","the","final","step",".","Attributes","--","--","--","--","--","T",":","fp32"]
code: def default_inputs(self):
      return DefaultInputs(
          bias=None,
          direction="forward",
          output_sequence=False,
          activation="tanh",
      )
  
file_path: coremltools/coremltools/converters/mil/mil/ops/defs/iOS15/recurrent.py
imports: from coremltools.converters.mil.mil import Operation, Var, types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, TensorInputType
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
label_desc: Use image node_id 1 for calling the rnn obj's underlying member method code with example usage: obj.default_inputs() and returns: DefaultInputs