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

Method initialize

examples/singa_peft/examples/model/trans.py:517–522  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

515 self.eps = eps
516
517 def initialize(self, x):
518 shape = (self.n_features,)
519 self.Gamma = Tensor(shape=shape, dtype=x.dtype, requires_grad=False, stores_grad=False)
520 self.Beta = Tensor(shape=shape, dtype=x.dtype, requires_grad=False, stores_grad=False)
521 self.Gamma.set_value(1.0)
522 self.Beta.set_value(0.0)
523
524 def forward(self, x):
525 # 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