MCPcopy Create free account
hub / github.com/pytorch/pytorch / create_states

Method create_states

caffe2/python/rnn_cell.py:893–903  ·  view source on GitHub ↗
(self, model)

Source from the content-addressed store, hash-verified

891 self.cells = cells
892
893 def create_states(self, model):
894 states = []
895 for i, cell in enumerate(self.cells):
896 if cell.initializer is None:
897 raise Exception("Either initial states "
898 "or initializer have to be set")
899
900 with core.NameScope("layer_{}".format(i)),\
901 core.NameScope(cell.name):
902 states.extend(cell.initializer.create_states(model))
903 return states
904
905
906class MultiRNNCell(RNNCell):

Callers

nothing calls this directly

Calls 4

ExceptionClass · 0.85
formatMethod · 0.45
extendMethod · 0.45
create_statesMethod · 0.45

Tested by

no test coverage detected