Exemple #1
0
        internal static void GetTypeAndWidth(Tensors.TensorElementType elemType, out Type type, out int width)
        {
            TensorElementTypeInfo result = TensorBase.GetElementTypeInfo(elemType);

            if (result != null)
            {
                type  = result.TensorType;
                width = result.TypeSize;
            }
            else
            {
                throw new ArgumentException("Unable to get information for type: " + elemType.ToString());
            }
        }
Exemple #2
0
        internal static void GetTypeAndWidth(Tensors.TensorElementType elemType, out Type type, out int width)
        {
            TensorElementTypeInfo result = TensorBase.GetElementTypeInfo(elemType);

            if (result != null)
            {
                type  = result.TensorType;
                width = result.TypeSize;
            }
            else
            {
                type  = null;
                width = 0;
            }
        }
Exemple #3
0
        public static bool GetTypeAndWidth(TensorElementType elemType, out Type type, out int width)
        {
            bool result = true;
            TensorElementTypeInfo typeInfo = TensorBase.GetElementTypeInfo(elemType);

            if (typeInfo != null)
            {
                type  = typeInfo.TensorType;
                width = typeInfo.TypeSize;
            }
            else
            {
                type   = null;
                width  = 0;
                result = false;
            }
            return(result);
        }