mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-06-27 20:53:09 +08:00
4ad01ea2e3
isort --recursive --atomic --apply pts
12 lines
228 B
Python
12 lines
228 B
Python
import torch
|
|
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)
|