MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / build

Method build

tensorflow/python/ops/rnn_cell_impl.py:726–741  ·  view source on GitHub ↗
(self, inputs_shape)

Source from the content-addressed store, hash-verified

724
725 @tf_utils.shape_type_conversion
726 def build(self, inputs_shape):
727 if inputs_shape[-1] is None:
728 raise ValueError("Expected inputs.shape[-1] to be known, saw shape: %s" %
729 str(inputs_shape))
730 _check_supported_dtypes(self.dtype)
731 input_depth = inputs_shape[-1]
732 h_depth = self._num_units
733 self._kernel = self.add_variable(
734 _WEIGHTS_VARIABLE_NAME,
735 shape=[input_depth + h_depth, 4 * self._num_units])
736 self._bias = self.add_variable(
737 _BIAS_VARIABLE_NAME,
738 shape=[4 * self._num_units],
739 initializer=init_ops.zeros_initializer(dtype=self.dtype))
740
741 self.built = True
742
743 def call(self, inputs, state):
744 """Long short-term memory cell (LSTM).

Callers

nothing calls this directly

Calls 2

_check_supported_dtypesFunction · 0.85
add_variableMethod · 0.45

Tested by

no test coverage detected