class_docstr: Attributes:
  layer_list - a list of layer names in the Keras model
  connection_map - a map where the key is a layer, the value is a list of its successors
  reverse_connection_map - a map where the key is a layer, the value is a list of its predecessors
  keras_layer_map - a map where the key is a layer name, the value is Keras layer
  model - a reference of the keras model.
  blob_names - blob names for each one of the edge.
class_docstr_tok: ["Attributes",":","layer_list","-","a","list","of","layer","names","in","the","Keras","model","connection_map","-","a","map","where","the","key","is","a","layer",",","the","value","is","a","list","of","its","successors","reverse_connection_map","-","a","map","where","the","key","is","a","layer",",","the","value","is","a","list","of","its","predecessors","keras_layer_map","-","a","map","where","the","key","is","a","layer","name",",","the","value","is","Keras","layer","model","-","a","reference","of","the","keras","model",".","blob_names","-","blob","names","for","each","one","of","the","edge","."]
code: def add_recurrent_optionals(self):
      # call this after blob names are generated
      for layer in self.layer_list:
          keras_layer = self.keras_layer_map[layer]
          if type(keras_layer) in _KERAS_RECURRENT_LAYERS:
              if not isinstance(
                  keras_layer, _keras.layers.wrappers.Bidirectional
              ):
                  hidden_size = keras_layer.output_dim
              else:
                  hidden_size = keras_layer.forward_layer.output_dim
              h_in_name = layer + "_h_in"
              h_out_name = layer + "_h_out"
              self.optional_inputs.append((h_in_name, hidden_size))
              self.optional_outputs.append((h_out_name, hidden_size))
              _insert_to_dict(
                  self.layers_optional_inputs, layer, h_in_name
              )
              _insert_to_dict(
                  self.layers_optional_outputs, layer, h_out_name
              )
              if isinstance(keras_layer, _keras.layers.recurrent.LSTM):
                  c_in_name = layer + "_c_in"
                  c_out_name = layer + "_c_out"
                  self.optional_inputs.append((c_in_name, hidden_size))
                  self.optional_outputs.append(
                      (c_out_name, hidden_size)
                  )
                  _insert_to_dict(
                      self.layers_optional_inputs, layer, c_in_name
                  )
                  _insert_to_dict(
                      self.layers_optional_outputs, layer, c_out_name
                  )
              elif isinstance(
                  keras_layer, _keras.layers.wrappers.Bidirectional
              ):
                  c_in_name = layer + "_c_in"
                  c_out_name = layer + "_c_out"
                  h_in_name_rev = layer + "_h_in_rev"
                  c_in_name_rev = layer + "_c_in_rev"
                  h_out_name_rev = layer + "_h_out_rev"
                  c_out_name_rev = layer + "_c_out_rev"
                  self.optional_inputs.append((c_in_name, hidden_size))
                  self.optional_outputs.append(
                      (c_out_name, hidden_size)
                  )
                  self.optional_inputs.append(
                      (h_in_name_rev, hidden_size)
                  )
                  self.optional_inputs.append(
                      (c_in_name_rev, hidden_size)
                  )
                  self.optional_outputs.append(
                      (h_out_name_rev, hidden_size)
                  )
                  self.optional_outputs.append(
                      (c_out_name_rev, hidden_size)
                  )
                  _insert_to_dict(
                      self.layers_optional_inputs, layer, c_in_name
                  )
                  _insert_to_dict(
                      self.layers_optional_outputs, layer, c_out_name
                  )
                  _insert_to_dict(
                      self.layers_optional_inputs, layer, h_in_name_rev
                  )
                  _insert_to_dict(
                      self.layers_optional_inputs, layer, c_in_name_rev
                  )
                  _insert_to_dict(
                      self.layers_optional_outputs,
                      layer,
                      h_out_name_rev,
                  )
                  _insert_to_dict(
                      self.layers_optional_outputs,
                      layer,
                      c_out_name_rev,
                  )
  
imports: import keras
  import numpy
label_desc: Use image node_id 14 for calling the NetGraph obj's underlying member method code with example usage: obj.add_recurrent_optionals() without return types