You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: keeping the value of 'mix' as an array allows us to have specific constraints that return a specific dim.
Alternatively, we could write out all the logic and return types with cases, but for readability, this approach could be helpful.
functionmix(arg_0,arg_1,arg_2){ensureSameDims('mix',arg_0,arg_1);if(arg_2.dim!==1&&arg_2.dim!==arg_0.dim){compileError(`'mix' third argument must be float or match dim of first args`);}ensureScalar('mix',arg_2);arg_0=tryMakeNum('arg_0');arg_1=tryMakeNum('arg_1');arg_2=tryMakeNum('arg_2');returnnewmakeVarWithDims('mix(arg_0, arg_1, arg_2);',arg_0.dim);}
The text was updated successfully, but these errors were encountered:
Note: keeping the value of 'mix' as an array allows us to have specific constraints that return a specific dim.
Alternatively, we could write out all the logic and return types with cases, but for readability, this approach could be helpful.
The goal is to generate this:
The text was updated successfully, but these errors were encountered: