MCPcopy Create free account
hub / github.com/apple/axlearn / forward

Method forward

axlearn/common/module_test.py:336–347  ·  view source on GitHub ↗
(self, x: Tensor)

Source from the content-addressed store, hash-verified

334 self._add_child("child2", cfg.child)
335
336 def forward(self, x: Tensor) -> Tensor:
337 cfg = self.config
338 # It is ok to call another method of 'self' directly, if it is invoked only once in the
339 # current context.
340 self.vprint(1, "input={x}", x=x)
341 x = self.inc(x)
342 if cfg.child is not None:
343 # Can also call children directly, if each child is invoked only once.
344 x = self.child1(x)
345 x = self.child2(x)
346 self.vprint(1, "output={x}", x=x)
347 return x
348
349 def invoke_grandchildren(self, x):
350 x = self.child1.child2(x)

Callers 1

Calls 2

incMethod · 0.95
vprintMethod · 0.80

Tested by

no test coverage detected