MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / forward

Method forward

verify.py:489–507  ·  view source on GitHub ↗
(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

487 self.eps = getattr(original, "eps", 1e-6)
488
489 def forward(self, x: torch.Tensor) -> torch.Tensor:
490 orig_shape = x.shape
491 if x.dim() > 2:
492 x_2d = x.reshape(-1, x.shape[-1])
493 else:
494 x_2d = x
495
496 if self.weight is not None:
497 try:
498 out = self.kernel_fn(x_2d, self.weight, self.eps)
499 except TypeError:
500 out = self.kernel_fn(x_2d, self.weight)
501 else:
502 out = self.kernel_fn(x_2d)
503
504 if len(orig_shape) > 2:
505 out = out.reshape(orig_shape)
506
507 return out
508
509
510class OptimizedModelContext:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected