fwgrad.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:tensorflow-forward-ad 作者: renmengye 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号