Exemplo n.º 1
0
            /// <summary>
            /// Return the ONNX value for a <see cref="IDataView"/> input column called <paramref name="name"/>.
            /// </summary>
            public OnnxVariableInfo GetInput(string name)
            {
                var index = InputNames.IndexOf(name);

                if (index < 0)
                {
                    throw Contracts.ExceptParamValue(name, nameof(name), $"Input tensor, {name}, does not exist in the ONNX model. " +
                                                     $"Available input names are [{string.Join(",", InputNames)}].");
                }
                return(InputsInfo[index]);
            }
Exemplo n.º 2
0
            /// <summary>
            /// Return the ONNX value for a <see cref="IDataView"/> input column called <paramref name="name"/>.
            /// </summary>
            public OnnxVariableInfo GetInput(string name)
            {
                var index = InputNames.IndexOf(name);

                if (index >= 0)
                {
                    return(InputsInfo[index]);
                }

                index = InitializerNames.IndexOf(name);
                if (index >= 0)
                {
                    return(InitializersInfo[index]);
                }

                // If we dont find the index in the input, try find it in the initializers
                throw Contracts.ExceptParamValue(name, nameof(name), $"Input tensor, {name}, does not exist in the ONNX model. " +
                                                 $"Available input names are [{string.Join(",", InputNames)}]. Available initializers are [{string.Join(",", InitializerNames)}]");
            }