class_docstr: A gated recurrent unit (GRU) cell
  
  DP-friendly drop-in replacement of the ``torch.nn.GRUCell`` module to use in ``DPGRU``.
  Refer to ``torch.nn.GRUCell`` documentation for the model description, parameters and inputs/outputs.
class_docstr_tok: ["A","gated","recurrent","unit","(","GRU",")","cell","DP-friendly","drop-in","replacement","of","the","``","torch.nn.GRUCell","``","module","to","use","in","``","DPGRU","``",".","Refer","to","``","torch.nn.GRUCell","``","documentation","for","the","model","description",",","parameters","and","inputs\/outputs","."]
code: def forward(
      self,
      input: Tensor,
      hx: Optional[Tensor] = None,
      batch_size_t: Optional[int] = None,
  ) -> Tensor:
      if hx is None:
          hx = torch.zeros(
              input.shape[0],
              self.hidden_size,
              dtype=input.dtype,
              device=input.device,
          )
  
      h_prev = hx if batch_size_t is None else hx[:batch_size_t, :]
      gates_x = self.ih(input)
      gates_h = self.hh(h_prev)
      r_t_input_x, z_t_input_x, n_t_input_x = torch.split(
          gates_x, self.hidden_size, 1
      )
      r_t_input_h, z_t_input_h, n_t_input_h = torch.split(
          gates_h, self.hidden_size, 1
      )
      r_t = torch.sigmoid(r_t_input_x + r_t_input_h)
      z_t = torch.sigmoid(z_t_input_x + z_t_input_h)
      n_t = torch.tanh(n_t_input_x + r_t * n_t_input_h)
      h_t = (1 - z_t) * n_t + z_t * h_prev
      return h_t
  
imports: import math
  import numbers
  import warnings
  from typing import List, Optional, Tuple, Type, Union
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn.utils.rnn import PackedSequence
  from ..utils.packed_sequences import compute_seq_lengths
  from .param_rename import RenameParamsMixin
label_desc: Use image node_id 2 for calling the DPGRUCell obj's underlying member method code with example usage: obj.forward(input, hx, batch_size_t) and returns: h_t