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

Method build

tensorflow/python/keras/layers/recurrent.py:144–159  ·  view source on GitHub ↗
(self, input_shape)

Source from the content-addressed store, hash-verified

142
143 @tf_utils.shape_type_conversion
144 def build(self, input_shape):
145 if isinstance(input_shape, list):
146 input_shape = input_shape[0]
147 for cell in self.cells:
148 if isinstance(cell, Layer):
149 if not cell.built:
150 cell.build(input_shape)
151 if getattr(cell, 'output_size', None) is not None:
152 output_dim = cell.output_size
153 elif _is_multiple_state(cell.state_size):
154 output_dim = cell.state_size[0]
155 else:
156 output_dim = cell.state_size
157 input_shape = tuple([input_shape[0]] +
158 tensor_shape.as_shape(output_dim).as_list())
159 self.built = True
160
161 def get_config(self):
162 cells = []

Callers

nothing calls this directly

Calls 4

_is_multiple_stateFunction · 0.85
tupleFunction · 0.85
buildMethod · 0.65
as_listMethod · 0.45

Tested by

no test coverage detected