Backends/SiaNet.Backend.TensorSharp/DType.cs
/// <summary>
/// Froms the type of the color.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>DType.</returns>
/// <exception cref="NotSupportedException">No corresponding DType value for CLR type " + type</exception>
Froms the type of the color.
Froms the type of the color .
public static DType FromCLRType(Type type)
        {
            if (type == typeof(Half)) return DType.Float16;
            else if (type == typeof(float)) return DType.Float32;
            else if (type == typeof(double)) return DType.Float64;
            else if (type == typeof(int)) return DType.Int32;
            else if (type == typeof(byte)) return DType.UInt8;
            else
                throw new NotSupportedException("No corresponding DType value for CLR type " + type);
        }
public static DType FromCLRType ( Type type ) { if ( type == typeof ( Half ) ) return DType . Float16 ; else if ( type == typeof ( float ) ) return DType . Float32 ; else if ( type == typeof ( double ) ) return DType . Float64 ; else if ( type == typeof ( int ) ) return DType . Int32 ; else if ( type == typeof ( byte ) ) return DType . UInt8 ; else throw new NotSupportedException ( " " + type ) ; }
Froms the type of the color.
Froms the type of the color .
None
No corresponding DType value for CLR type " + type
No corresponding DType value for CLR type " + type
type
Type
None