removed tensor dep

上级 77c9fd0b
...@@ -4,23 +4,11 @@ ...@@ -4,23 +4,11 @@
# #
import unittest import unittest
import numpy import numpy
import tensor_ops as T
import tensor
import gof import gof
from gradient import * from gradient import *
import gradient import gradient
class posneg(T.TensorOp):
nout=2
def impl(self, x): return x, -x
def grad(self, x, (gpos, gneg)): return gpos - gneg
class posnegzero(T.TensorOp):
nout=3
def impl(self, x): return x, -x, 0.0
def grad(self, x, (gpos, gneg, gzero)): return gpos - gneg
class _test_grad_sources_inputs(unittest.TestCase): class _test_grad_sources_inputs(unittest.TestCase):
def test_retNone1(self): def test_retNone1(self):
"""Test that it is not ok to return None from op.grad()""" """Test that it is not ok to return None from op.grad()"""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论