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

Method create_states

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

Source from the content-addressed store, hash-verified

273 self.hidden_size = hidden_size
274
275 def create_states(self, model):
276 return [
277 model.create_param(
278 param_name='initial_hidden_state',
279 initializer=Initializer(operator_name='ConstantFill',
280 value=0.0),
281 shape=[self.hidden_size],
282 ),
283 model.create_param(
284 param_name='initial_cell_state',
285 initializer=Initializer(operator_name='ConstantFill',
286 value=0.0),
287 shape=[self.hidden_size],
288 )
289 ]
290
291
292# based on https://pytorch.org/docs/master/nn.html#torch.nn.RNNCell

Callers 2

apply_over_sequenceMethod · 0.45
create_statesMethod · 0.45

Calls 2

InitializerClass · 0.90
create_paramMethod · 0.45

Tested by

no test coverage detected