コード例 #1
0
        public static string GetTagSuffix(MLModelType type)
        {
            switch (type)
            {
            case MLModelType.Cpu:
                return("cpu");

            case MLModelType.CpuNoAvx:
                return("cpu-no-avx");

            case MLModelType.Gpu:
                return("gpu");

            //case MLModelType.Tpu:
            //    return "tpu";
            //case MLModelType.TpuNoAvx:
            //    return "tpu-no-avx";
            //case MLModelType.TpuCpu:
            //    return "tpu-cpu";
            //case MLModelType.TpuCpuNoAvx:
            //    return "tpu-cpu-no-avx";
            //case MLModelType.TpuGpu:
            //    return "tpu-gpu";
            default:
                throw new Exception($"Invalid model type: {type.ToString()}.");
            }
        }
コード例 #2
0
 public MlModelData(string name, MLModelType type, uint version, uint apiVersion)
 {
     Name       = name;
     Type       = type;
     Version    = version;
     ApiVersion = apiVersion;
 }
コード例 #3
0
 public static string GetDockerTag(uint apiVersion, uint modelVersion, MLModelType type)
 {
     return($"{apiVersion}.{modelVersion}-{GetTagSuffix(type)}");
 }