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

Method build

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

Source from the content-addressed store, hash-verified

445
446 @tf_utils.shape_type_conversion
447 def build(self, inputs_shape):
448 if inputs_shape[-1] is None:
449 raise ValueError("Expected inputs.shape[-1] to be known, saw shape: %s" %
450 str(inputs_shape))
451 _check_supported_dtypes(self.dtype)
452
453 input_depth = inputs_shape[-1]
454 self._kernel = self.add_variable(
455 _WEIGHTS_VARIABLE_NAME,
456 shape=[input_depth + self._num_units, self._num_units])
457 self._bias = self.add_variable(
458 _BIAS_VARIABLE_NAME,
459 shape=[self._num_units],
460 initializer=init_ops.zeros_initializer(dtype=self.dtype))
461
462 self.built = True
463
464 def call(self, inputs, state):
465 """Most basic RNN: output = new_state = act(W * input + U * state + B)."""

Callers

nothing calls this directly

Calls 2

_check_supported_dtypesFunction · 0.85
add_variableMethod · 0.45

Tested by

no test coverage detected