PyNorch/norch/nn/parameter.py
2024-05-25 10:53:09 -03:00

11 lines
No EOL
301 B
Python

from norch.tensor import Tensor
from norch.utils import functions
import random
class Parameter(Tensor):
"""
A parameter is a trainable tensor.
"""
def __init__(self, shape):
data = functions.generate_random_list(shape=shape)
super().__init__(data, requires_grad=True)