Backends/SiaNet.Backend.TensorSharp/Cpu/NativeWrapper.cs
/// <summary>
/// Invokes the nullable result dimensionwise.
/// </summary>
/// <param name="method">The method.</param>
/// <param name="result">The result.</param>
/// <param name="src">The source.</param>
/// <param name="dimension">The dimension.</param>
/// <param name="extraArgs">The extra arguments.</param>
/// <returns>Tensor.</returns>
/// <exception cref="ArgumentOutOfRangeException">dimension</exception>
Invokes the nullable result dimensionwise.
Invokes the nullable result dimensionwise .
public static NDArray InvokeNullableResultDimensionwise(MethodInfo method, NDArray result, NDArray src, int dimension, params object[] extraArgs)
        {
            if (dimension < 0 || dimension >= src.Shape.Length) throw new ArgumentOutOfRangeException("dimension");
            var desiredSize = (long[])src.Shape.Clone();
            desiredSize[dimension] = 1;
            var resultTensor = TensorResultBuilder.GetWriteTarget(result, src, false, desiredSize);
            var finalArgs = new List<object>(extraArgs.Length + 3);
            finalArgs.Add(resultTensor);
            finalArgs.Add(src);
            finalArgs.Add(dimension);
            finalArgs.AddRange(extraArgs);
            InvokeTypeMatch(method, finalArgs.ToArray());
            return resultTensor;
        }
public static NDArray InvokeNullableResultDimensionwise ( MethodInfo method , NDArray result , NDArray src , int dimension , params object [ ] extraArgs ) { if ( dimension < 0 || dimension >= src . Shape . Length ) throw new ArgumentOutOfRangeException ( " " ) ; var desiredSize = ( long [ ] ) src . Shape . Clone ( ) ; desiredSize [ dimension ] = 1 ; var resultTensor = TensorResultBuilder . GetWriteTarget ( result , src , false , desiredSize ) ; var finalArgs = new List < object > ( extraArgs . Length + 3 ) ; finalArgs . Add ( resultTensor ) ; finalArgs . Add ( src ) ; finalArgs . Add ( dimension ) ; finalArgs . AddRange ( extraArgs ) ; InvokeTypeMatch ( method , finalArgs . ToArray ( ) ) ; return resultTensor ; }
Invokes the nullable result dimensionwise.
Invokes the nullable result dimensionwise .
None
None
method
MethodInfo
None
result
NDArray
None
src
NDArray
None
dimension
int
None
extraArgs
The extra arguments.
The extra arguments .