Backends/SiaNet.Backend.TensorSharp/OpRegistry.cs
/// <summary>
/// Invokes the specified op name.
/// </summary>
/// <param name="opName">Name of the op.</param>
/// <param name="args">The arguments.</param>
/// <returns>System.Object.</returns>
/// <exception cref="ApplicationException">
/// None of the registered handlers match the arguments for " + opName
/// or
/// No handlers have been registered for op " + opName
/// </exception>
Invokes the specified op name.
Invokes the specified op name .
public static object Invoke(string opName, params object[] args)
        {
            List<OpInstance> instanceList;
            if (opInstances.TryGetValue(opName, out instanceList))
            {
                foreach (var instance in instanceList)
                {
                    if (instance.constraints.All(x => x.SatisfiedFor(args)))
                    {
                        return instance.handler.Invoke(args);
                    }
                }
                throw new ApplicationException("None of the registered handlers match the arguments for " + opName);
            }
            else
            {
                throw new ApplicationException("No handlers have been registered for op " + opName);
            }
        }
public static object Invoke ( string opName , params object [ ] args ) { List < OpInstance > instanceList ; if ( opInstances . TryGetValue ( opName , out instanceList ) ) { foreach ( var instance in instanceList ) { if ( instance . constraints . All ( x => x . SatisfiedFor ( args ) ) ) { return instance . handler . Invoke ( args ) ; } } throw new ApplicationException ( " " + opName ) ; } else { throw new ApplicationException ( " " + opName ) ; } }
Invokes the specified op name.
Invokes the specified op name .
None
None of the registered handlers match the arguments for " + opName
or
No handlers have been registered for op " + opName
None of the registered handlers match the arguments for " + opName or No handlers have been registered for op " + opName
opName
string
Name of the op.
Name of the op .
args
None