parameters: (layer)
return_statement: return result
docstring: Serialize a GPU-trained GRU layer to dict
docstring_summary: Serialize a GPU-trained GRU layer to dict
docstring_tokens: Serialize a GPU - trained GRU layer to dict
function: def show_cudnn_gru_layer(layer):
      """Serialize a GPU-trained GRU layer to dict"""
      weights = layer.get_weights()
      assert len(weights) == 3  # CuDNN GRU always has a bias
  
      n_gates = 3
      input_weights, recurrent_weights = transform_cudnn_weights(weights[0], weights[1], n_gates)
  
      result = {'weights': encode_floats(input_weights),
                'recurrent_weights': encode_floats(recurrent_weights),
                'bias': encode_floats(weights[2])}
  
      return result
function_tokens: def show_cudnn_gru_layer ( layer ) : weights = layer . get_weights ( ) assert len ( weights ) == 3 # CuDNN GRU always has a bias n_gates = 3 input_weights , recurrent_weights = transform_cudnn_weights ( weights [ 0 ] , weights [ 1 ] , n_gates ) result = { 'weights' : encode_floats ( input_weights ) , 'recurrent_weights' : encode_floats ( recurrent_weights ) , 'bias' : encode_floats ( weights [ 2 ] ) } return result