Exemple #1
0
 /// <summary>
 /// Constructor for init data type
 /// internal storage is 1D with 1 element
 /// </summary>
 /// <param name="dtype">Data type of elements</param>
 /// <param name="engine">The engine of this <see cref="NDArray"/></param>
 /// <remarks>This constructor does not call allocation/></remarks>
 protected internal NDArray(TensorEngine engine) : base(typeof(T).GetTypeCode(), engine)
 {
 }
Exemple #2
0
 /// <summary>
 ///     Interchange two axes of an array.
 /// </summary>
 /// <param name="a">Input array.</param>
 /// <param name="axis1">First axis.</param>
 /// <param name="axis2">Second axis.</param>
 /// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.swapaxes.html</remarks>
 public NDArray swapaxes(int axis1, int axis2)
 => TensorEngine.SwapAxes(this, axis1, axis2);
Exemple #3
0
 /// <summary>
 /// Constructor for init data type
 /// internal storage is 1D with 1 element
 /// </summary>
 /// <param name="dtype">Data type of elements</param>
 /// <param name="engine">The engine of this <see cref="NDArray"/></param>
 /// <remarks>This constructor does not call allocation/></remarks>
 protected internal NDArray(TensorEngine engine) : base(InfoOf <TDType> .NPTypeCode, engine)
 {
 }
Exemple #4
0
 /// <summary>
 /// Negates all values by performing: -x
 /// </summary>
 public NDArray negate()
 {
     return(TensorEngine.Negate(this));
 }