Skip to content

Instantly share code, notes, and snippets.

@Eeman1113
Created May 22, 2024 20:42
Show Gist options
  • Save Eeman1113/12b38103d2f021a1b3bed49a1dd60ea7 to your computer and use it in GitHub Desktop.
Save Eeman1113/12b38103d2f021a1b3bed49a1dd60ea7 to your computer and use it in GitHub Desktop.
from norch.tensor import Tensor
from norch.utils import utils
import random
class Parameter(Tensor):
"""
A parameter is a trainable tensor.
"""
def __init__(self, shape):
data = utils.generate_random_list(shape=shape)
super().__init__(data, requires_grad=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment