operator_schema.h
- NumInputs()
// Functions to set the property of the operator schemas.
// Sets the number of inputs, either a fixed number or a min and a max.
/**
* @brief A single input.
*/
OpSchema& NumInputs(int n);//指定一个特定的数量
/*
OPERATOR_SCHEMA(Recurrent)
.NumInputs(4)
*/
/**
* @brief Input could be in range [min, max], inclusive.
*/
OpSchema& NumInputs(int min, int max);//在(a,b)范围内,包括a,b
/*
.NumInputs(1, 4)
*/
/**
* @brief Input could be one of the values specified in allowed_input_nums.
*/
OpSchema& NumInputs(set<int> allowed_input_nums);//{a,b,c,d}选一个
/*
.NumInputs({4, 7})
*/
/**
* @brief Input is checked with a specified function.
*/
OpSchema& NumInputs(std::function<bool(int)> func);
/*
.NumInputs([](int n) { return n > 0 && n % 2 == 0; })
*/
NumOutputs() 与NumInputs() 用法相同