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
As an example, this does not compile:
defn uniform(opts \\ []) do shape = transform(opts, &Keyword.fetch!(&1, :shape)) opts = keyword!(opts, type: {:f, 32}, shape: {}, scale: 1.0e-2) Nx.random_uniform(shape, type: opts[:type]) * opts[:scale] end
But this does:
defn uniform(_t, opts \\ []) do shape = transform(opts, &Keyword.fetch!(&1, :shape)) opts = keyword!(opts, type: {:f, 32}, shape: {}, scale: 1.0e-2) Nx.random_uniform(shape, type: opts[:type]) * opts[:scale] end
Even though t is unused.
t
The text was updated successfully, but these errors were encountered:
Nice catch, I will fix it soon.
Btw, if you want to validate a key but not give it a default value., you can write it like this:
opts = keyword!(opts, [:shape, type: {:f, 32}, scale: 1.0e-2])
But the current way is fine given you assert for the shape first.
Sorry, something went wrong.
9af1536
No branches or pull requests
As an example, this does not compile:
But this does:
Even though
t
is unused.The text was updated successfully, but these errors were encountered: