| 108 | from timm.layers import Mlp |
| 109 | except ImportError: |
| 110 | class Mlp(nn.Module): |
| 111 | def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.): |
| 112 | super().__init__() |
| 113 | out_features = out_features or in_features |
| 114 | hidden_features = hidden_features or in_features |
| 115 | self.fc1 = nn.Linear(in_features, hidden_features) |
| 116 | self.act = act_layer() |
| 117 | self.fc2 = nn.Linear(hidden_features, out_features) |
| 118 | def forward(self, x): |
| 119 | return self.fc2(self.act(self.fc1(x))) |
| 120 | |
| 121 | |
| 122 | def save_tensor(path, t): |
nothing calls this directly
no outgoing calls
no test coverage detected