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
from functools import partial
import jax
@partial(pmap, axis_name='rows')
@partial(pmap, axis_name='cols')
def normalize(x):
row_normed = x / jax.lax.psum(x, 'rows')
col_normed = x / jax.lax.psum(x, 'cols')
doubly_normed = x / jax.lax.psum(x, ('rows', 'cols'))
return row_normed, col_normed, doubly_normed
In the above snippet, the two nesting pmaps refer to the row and column axes, respectively. How does this work? I did not find some useful documentation to explain the behaviors of nesting multiple pmaps. Can anyone help to give some more explanation? Thanks!
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.
-
In the above snippet, the two nesting
pmap
s refer to the row and column axes, respectively. How does this work? I did not find some useful documentation to explain the behaviors of nesting multiplepmap
s. Can anyone help to give some more explanation? Thanks!Beta Was this translation helpful? Give feedback.
All reactions