def Div_FwGrad(op, dx, dy, _op_table=None, _grad_table=None):
x = op.inputs[0]
y = op.inputs[1]
if dx is None and dy is None:
return None
elif dx is not None and dy is None:
return tf.divide(dx, y)
elif dy is not None and dx is None:
return -tf.divide(x * dy, y**2)
else:
return tf.divide(y * dx - x * dy, y**2)
评论列表
文章目录