Skip to content

Commit c7b005b

Browse files
test
1 parent 21aec30 commit c7b005b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

include/tensor_bind.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ PYBIND11_MODULE(tensor2, m)
170170
.def(hash(pybind11::self))
171171
.def("transpose", &Tensor::transpose)
172172
.def("calc_grad", &Tensor::calc_grad)
173+
.def("get_grad", &Tensor::get_grad)
173174
.def("sin", &Tensor::sin)
174175
.def("sin", &Tensor::sin)
175176
.def("cos", &Tensor::cos)

src/TensorArray/core/tensor2.so

-720 Bytes
Binary file not shown.

src/TensorArray/layers/Linear.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
1+
from TensorArray.core import tensor2 as t
22
from typing import Any
33

44

55
class Linear:
66
def __init__(self) -> None:
7-
self.w
8-
self.b
9-
pass
7+
self.w = t.Tensor(0)
8+
self.b = t.Tensor(0)
109

1110
def __call__(self, input) -> Any:
1211
return input @ self.w + self.b

0 commit comments

Comments
 (0)