MCPcopy Create free account
hub / github.com/apache/singa / initialize

Method initialize

examples/trans/model.py:523–528  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

521 self.eps = eps
522
523 def initialize(self, x):
524 shape = (self.n_features,)
525 self.Gamma = Tensor(shape=shape, dtype=x.dtype, requires_grad=False, stores_grad=False)
526 self.Beta = Tensor(shape=shape, dtype=x.dtype, requires_grad=False, stores_grad=False)
527 self.Gamma.set_value(1.0)
528 self.Beta.set_value(0.0)
529
530 def forward(self, x):
531 # x: input tensor with shape [batch_size, n_features]

Callers

nothing calls this directly

Calls 2

TensorClass · 0.90
set_valueMethod · 0.45

Tested by

no test coverage detected