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
This throws a compiler error that the dropout_mask (in the second if statement) doesn't exist. I guess it doesnt understand that if a variable is created for one condition, it would exist for all other occurrences of that condition.
So I can solve this in two ways, neither of which I like. I can either recompute the mask again, as its a seeded generator so we get the same results anyway but that adds extra ops we can avoid
But then we are always doing a memory allocation even when not using dropout. I could also just copy paste my kernel (one with dropout and one without) and then handle the if/else on which kernel I want to call which would fix this, but I wanted to know if there is a better way to handle this that I am missing!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am relatively new to this, but am working on a dropout implementation for the forward and backward pass.
This is what I would like to do:
This throws a compiler error that the dropout_mask (in the second if statement) doesn't exist. I guess it doesnt understand that if a variable is created for one condition, it would exist for all other occurrences of that condition.
So I can solve this in two ways, neither of which I like. I can either recompute the mask again, as its a seeded generator so we get the same results anyway but that adds extra ops we can avoid
Or we can always create a variable called dropout_mask at the start like this
But then we are always doing a memory allocation even when not using dropout. I could also just copy paste my kernel (one with dropout and one without) and then handle the if/else on which kernel I want to call which would fix this, but I wanted to know if there is a better way to handle this that I am missing!
Beta Was this translation helpful? Give feedback.
All reactions