Backends/SiaNet.Backend.TensorSharp/Cpu/NativeWrapper.cs
/// <summary>
/// Invokes the nullable result elementwise.
/// </summary>
/// <param name="method">The method.</param>
/// <param name="args">The arguments.</param>
/// <returns>Tensor.</returns>
Invokes the nullable result elementwise.
Invokes the nullable result elementwise .
public static NDArray InvokeNullableResultElementwise(MethodInfo method, params object[] args)
        {
            NDArray resultTensor;
            if(args[0] == null)
            {
                var otherTensor = args.OfType<NDArray>().First();
                resultTensor = TensorResultBuilder.GetWriteTarget(null, otherTensor, false, otherTensor.Shape);
            }
            else
            {
                var resultSrc = (NDArray)args[0];
                var otherTensor = args.OfType<NDArray>().Skip(1).First();
                resultTensor = TensorResultBuilder.GetWriteTarget(resultSrc, otherTensor, false, otherTensor.Shape);
            }
            args[0] = resultTensor;
            InvokeTypeMatch(method, args);
            return resultTensor;
        }
public static NDArray InvokeNullableResultElementwise ( MethodInfo method , params object [ ] args ) { NDArray resultTensor ; if ( args [ 0 ] == null ) { var otherTensor = args . OfType < NDArray > ( ) . First ( ) ; resultTensor = TensorResultBuilder . GetWriteTarget ( null , otherTensor , false , otherTensor . Shape ) ; } else { var resultSrc = ( NDArray ) args [ 0 ] ; var otherTensor = args . OfType < NDArray > ( ) . Skip ( 1 ) . First ( ) ; resultTensor = TensorResultBuilder . GetWriteTarget ( resultSrc , otherTensor , false , otherTensor . Shape ) ; } args [ 0 ] = resultTensor ; InvokeTypeMatch ( method , args ) ; return resultTensor ; }
Invokes the nullable result elementwise.
Invokes the nullable result elementwise .
None
method
MethodInfo
None
args
None