/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> public override NDArray Evaluate(NDArray writeTarget) { using (var lhs = left.Evaluate(null)) { return(evaluate(writeTarget, lhs, right.Evaluate())); } }
/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> public override NDArray Evaluate(NDArray writeTarget) { using (var rhs = right.Evaluate(null)) { return(evaluate(writeTarget, left.Evaluate(), rhs)); } }
/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> public override NDArray Evaluate(NDArray writeTarget) { using (var s = src.Evaluate(null)) { return(evaluate(writeTarget, s)); } }
/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> public override NDArray Evaluate(NDArray writeTarget) { using (var s = src.Evaluate(null)) using (var m1Val = m1.Evaluate(null)) using (var m2Val = m2.Evaluate(null)) { return(Ops.Addmm(writeTarget, beta, s, alpha, m1Val, m2Val)); } }
/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> /// <exception cref="InvalidOperationException">Cannot Select directly into another tensor</exception> public override NDArray Evaluate(NDArray writeTarget) { if (writeTarget != null) { throw new InvalidOperationException("Cannot Select directly into another tensor"); } using (var s = src.Evaluate(null)) { return(evaluate(s)); } }
/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> public override NDArray Evaluate(NDArray writeTarget) { using (var srcVal = src.Evaluate(null)) { if (writeTarget == null) { writeTarget = new NDArray(allocator, srcVal.ElementType, srcVal.Shape); } Ops.Copy(writeTarget, srcVal); return(writeTarget); } }
/// <summary> /// Evaluates the specified write target. /// </summary> /// <param name="writeTarget">The write target.</param> /// <returns>Tensor.</returns> public override NDArray Evaluate(NDArray writeTarget) { using (var s = src.Evaluate(null)) using (var i = indices.Evaluate(null)) { if (!writeTarget.Equals(s)) { Ops.Copy(writeTarget, s); } Ops.ScatterFill(writeTarget, value.Evaluate(), dimension, i); } return(writeTarget); }
/// <summary> /// Evaluates this instance. /// </summary> /// <returns>Tensor.</returns> public NDArray Evaluate() { return(expression.Evaluate(null)); }