File size: 440 Bytes
1ea89dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import torch
import torch.nn as nn


class Dummy(nn.Module):
    def __init__(self, *args, **kwargs):
        super().__init__()
        self.name: str = self.__class__.__name__
        self.weight = 1.0

    def forward(self, dummy: torch.Tensor, *args, **kwargs) -> torch.Tensor:
        return torch.tensor([0.0] * dummy.shape[0], device=dummy.device)

    @classmethod
    def build(cls, config):
        obj = cls()
        return obj