peft.Interceptor

peft.Interceptor#

class gemma.peft.Interceptor[source]

基类: etils.epy.contextlib.ContextManager, abc.ABC

拦截器的基类。

子类可以像这样用作上下文管理器

with MyInterceptor():
  y = nn.Dense(10)(x)
abstractmethod interceptor(
next_fun,
args,
kwargs,
context: flax.linen.module.InterceptorContext,
)[source]

返回要拦截的方法的名称。