Backends/SiaNet.Backend.TensorSharp/OpRegistry.cs
/// <summary>
/// Registers the specified op name.
/// </summary>
/// <param name="opName">Name of the op.</param>
/// <param name="handler">The handler.</param>
/// <param name="constraints">The constraints.</param>
Registers the specified op name.
Registers the specified op name .
public static void Register(string opName, OpHandler handler, IEnumerable<OpConstraint> constraints)
        {
            var newInstance = new OpInstance() { handler = handler, constraints = constraints };
            List<OpInstance> instanceList;
            if (opInstances.TryGetValue(opName, out instanceList))
            {
                instanceList.Add(newInstance);
            }
            else
            {
                instanceList = new List<OpInstance>();
                instanceList.Add(newInstance);
                opInstances.Add(opName, instanceList);
            }
        }
public static void Register ( string opName , OpHandler handler , IEnumerable < OpConstraint > constraints ) { var newInstance = new OpInstance ( ) { handler = handler , constraints = constraints } ; List < OpInstance > instanceList ; if ( opInstances . TryGetValue ( opName , out instanceList ) ) { instanceList . Add ( newInstance ) ; } else { instanceList = new List < OpInstance > ( ) ; instanceList . Add ( newInstance ) ; opInstances . Add ( opName , instanceList ) ; } }
Registers the specified op name.
Registers the specified op name .
opName
string
Name of the op.
Name of the op .
handler
OpHandler
None
constraints
IEnumerable<OpConstraint>
None