Backends/SiaNet.Backend.TensorSharp/TensorFormatting.cs
/// <summary>
/// Formats the size of the tensor type and.
/// </summary>
/// <param name="tensor">The tensor.</param>
/// <returns>System.String.</returns>
Formats the size of the tensor type and.
Formats the size of the tensor type and .
public static string FormatTensorTypeAndSize(NDArray tensor)
        {
            var result = new StringBuilder();
            result
                .Append("[")
                .Append(tensor.ElementType)
                .Append(" tensor");
            if (tensor.DimensionCount == 0)
            {
                result.Append(" with no dimension");
            }
            else
            {
                result
                .Append(" of size ")
                .Append(tensor.Shape[0]);
                for (int i = 1; i < tensor.DimensionCount; ++i)
                {
                    result.Append("x").Append(tensor.Shape[i]);
                }
            }
            result.Append(" on ").Append(tensor.Storage.LocationDescription());
            result.Append("]");
            return result.ToString();
        }
public static string FormatTensorTypeAndSize ( NDArray tensor ) { var result = new StringBuilder ( ) ; result . Append ( " " ) . Append ( tensor . ElementType ) . Append ( " " ) ; if ( tensor . DimensionCount == 0 ) { result . Append ( " " ) ; } else { result . Append ( " " ) . Append ( tensor . Shape [ 0 ] ) ; for ( int i = 1 ; i < tensor . DimensionCount ; ++ i ) { result . Append ( " " ) . Append ( tensor . Shape [ i ] ) ; } } result . Append ( " " ) . Append ( tensor . Storage . LocationDescription ( ) ) ; result . Append ( " " ) ; return result . ToString ( ) ; }
Formats the size of the tensor type and.
Formats the size of the tensor type and .
None
tensor
NDArray
None