We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In some operators, we may need attributes of which the type is std::vector<int>. We can define them in C++ code as follows:
attributes
std::vector<int>
AddAttr<std::vector<int>>("xNumColDims", "Some comments"); AddAttr<std::vector<int>>( "wNumColDims", "Some comments");
So, the problem is: we don't know the length in advance, "how to set the default value".
The text was updated successfully, but these errors were encountered:
Maybe we can just set an empty vector as the default value:
AddAttr<std::vector<int>>("xNumColDims", "Some comments").SetDefault(std::vector<int>{})
And call vector::reserve() in Kernel Code.
vector::reserve()
Sorry, something went wrong.
@Yancey1989 It works. Thanks.
No branches or pull requests
In some operators, we may need
attributes
of which the type isstd::vector<int>
. We can define them in C++ code as follows:So, the problem is: we don't know the length in advance, "how to set the default value".
The text was updated successfully, but these errors were encountered: