mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-06-27 20:38:14 +08:00
11 lines
215 B
Python
11 lines
215 B
Python
import torch.nn as nn
|
|
|
|
|
|
class LambdaLayer(nn.Module):
|
|
def __init__(self, function):
|
|
super().__init__()
|
|
self._func = function
|
|
|
|
def forward(self, x, *args):
|
|
return self._func(x, *args)
|