コード例 #1
0
def _ReciprocalGradGrad(op, grad):
  b = op.inputs[1]
  # op.output[0]: y = -b * conj(a)^2
  with ops.control_dependencies([grad]):
    ca = math_ops.conj(op.inputs[0])
    cg = math_ops.conj(grad)
    return cg * -2.0 * b * ca, gen_math_ops.reciprocal_grad(ca, grad)
コード例 #2
0
def _ReciprocalGradGrad(op, grad):
    b = op.inputs[1]
    # op.output[0]: y = -b * conj(a)^2
    with ops.control_dependencies([grad]):
        ca = math_ops.conj(op.inputs[0])
        cg = math_ops.conj(grad)
        return cg * -2.0 * b * ca, gen_math_ops.reciprocal_grad(ca, grad)
コード例 #3
0
def _ReciprocalGrad(op, grad):
  """Returns -grad * (1 / x^2)."""
  y = op.outputs[0]  # y = 1 / x
  return gen_math_ops.reciprocal_grad(y, grad)
コード例 #4
0
def _ReciprocalGrad(op, grad):
    """Returns -grad * (1 / x^2)."""
    y = op.outputs[0]  # y = 1 / x
    return gen_math_ops.reciprocal_grad(y, grad)