Last active
November 12, 2021 19:25
-
-
Save dhruvbird/4c6347e83e43e4ee1a1a11f7bddd46dd to your computer and use it in GitHub Desktop.
Simple Python code to create a very simple model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
class AddTensorsModel(torch.nn.Module): | |
def __init__(self): | |
super().__init__(); | |
self.t1 = torch.Tensor([0, 5, 10]) | |
def helper(self, x, y): | |
z = self.t1 | |
z = z + x + y | |
return z | |
def forward(self, x, y): | |
return self.helper(x, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment