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

Method forward

axlearn/common/summary_test.py:246–257  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

244 """A test `Module`."""
245
246 def forward(self):
247 # This logs a 7 row table with two columns where each cell contains a 16 x 16 color
248 # image.
249 # Shape: num examples x table columns x image height x image width x channels.
250 images = jax.numpy.ones((7, 2, 16, 16, 3))
251
252 def create_table(images: np.ndarray):
253 return wandb.Table(
254 ["output", "target"], [[wandb.Image(img) for img in row] for row in images]
255 )
256
257 self.add_summary("my_table", CallbackSummary(create_table, images))
258
259 module = _TestModule.default_config().set(name="tmp").instantiate(parent=None)
260

Callers 1

forwardMethod · 0.45

Calls 2

CallbackSummaryClass · 0.90
add_summaryMethod · 0.45

Tested by

no test coverage detected