示例#1
0
文件: ops.py 项目: pythonAI/miniflow
 def grad(self, partial_derivative_opname=None):
     # TODO: Check the type of op to compute gradients
     result = 1
     for op in self.ops:
         result *= op.grad(partial_derivative_opname)
     return result
示例#2
0
文件: ops.py 项目: pythonAI/miniflow
 def grad(self, partial_derivative_opname=None):
     result = 0
     for op in self.ops:
         result += op.grad(partial_derivative_opname)
     return result