add change log

This commit is contained in:
Dun Liang 2020-07-15 10:56:16 +08:00
parent bec2e710af
commit 787d35f02a
2 changed files with 76 additions and 0 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@ venv/
!*.src.md
!README.md
!README.cn.md
!CHANGELOG.md
python/jittor.egg-info
dist/
!doc/source/*

75
CHANGELOG.md Normal file
View File

@ -0,0 +1,75 @@
# CHANGELOG
### 计图 1.1.5.5
* 新增numpy code算子现在可以直接使用numpy来自定义算子了使用用例
```python
import jittor as jt
def forward_code(np, data):
a = data["inputs"][0]
b = data["outputs"][0]
np.add(a,a,out=b)
def backward_code(np, data):
dout = data["dout"]
out = data["outputs"][0]
np.copyto(out, dout*2.0)
a = jt.random((5,1))
b = jt.numpy_code(
a.shape,
a.dtype,
[a],
forward_code,
[backward_code],
)
```
* 新增 Function 模块,用户可以自定义反向传播了,使用用例:
```python
import jittor as jt
from jittor import Function
class MyFunc(Function):
def execute(self, x, y):
self.x = x
self.y = y
return x*y, x/y
def grad(self, grad0, grad1):
return grad0 * self.y, grad1 * self.x
a = jt.array(3.0)
b = jt.array(4.0)
func = MyFunc()
c,d = func(a, b)
da, db = jt.grad(c+d*3, [a, b])
assert da.data == 4
assert db.data == 9
```
* 新增 no_grad scope, 在这个scope中创建的所有变量都会停止梯度
```python
import jittor as jt
with jt.no_grad():
...
```
* 新增 bmmbatch matrix multiply 支持:
```
import jittor as jt
from jittor import nn
batch, n, m, k = 100, 5, 6, 7
a = jt.random((batch, n, m))
b = jt.random((batch, m, k))
c = nn.bmm(a, b)
```
* 修复 unsqueeze