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

Method zero_state

tensorflow/python/ops/rnn_cell_impl.py:1262–1269  ·  view source on GitHub ↗
(self, batch_size, dtype)

Source from the content-addressed store, hash-verified

1260 return self._cells[-1].output_size
1261
1262 def zero_state(self, batch_size, dtype):
1263 with ops.name_scope(type(self).__name__ + "ZeroState", values=[batch_size]):
1264 if self._state_is_tuple:
1265 return tuple(cell.zero_state(batch_size, dtype) for cell in self._cells)
1266 else:
1267 # We know here that state_size of each cell is not a tuple and
1268 # presumably does not contain TensorArrays or anything else fancy
1269 return super(MultiRNNCell, self).zero_state(batch_size, dtype)
1270
1271 @property
1272 def trainable_weights(self):

Calls 4

typeFunction · 0.85
tupleFunction · 0.85
name_scopeMethod · 0.45
zero_stateMethod · 0.45