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

Function init

caffe2/python/rnn_cell.py:1743–1757  ·  view source on GitHub ↗
(layer, pname, input_type)

Source from the content-addressed store, hash-verified

1741 recurrent_bias_size = dim_out
1742
1743 def init(layer, pname, input_type):
1744 input_weight_size_for_layer = input_weight_size if layer == 0 else \
1745 upper_layer_input_weight_size
1746 if pname in weight_params:
1747 sz = input_weight_size_for_layer if input_type == 'input' \
1748 else recurrent_weight_size
1749 elif pname in bias_params:
1750 sz = input_bias_size if input_type == 'input' \
1751 else recurrent_bias_size
1752 else:
1753 assert False, "unknown parameter type {}".format(pname)
1754 return model.param_init_net.UniformFill(
1755 [],
1756 "lstm_init_{}_{}_{}".format(input_type, pname, layer),
1757 shape=[sz])
1758
1759 # Multiply by 4 since we have 4 gates per LSTM unit
1760 first_layer_sz = input_weight_size + recurrent_weight_size + \

Callers 1

cudnn_LSTMFunction · 0.70

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…