Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. def block(x, scope, *, past, hparams):
  2. with tf.variable_scope(scope):
  3. nx = x.shape[-1].value
  4. a, present = attn(norm(x, 'ln_1'), 'attn', nx, past=past, hparams=hparams)
  5. x = x + a
  6. m = mlp(norm(x, 'ln_2'), 'mlp', nx*4, hparams=hparams)
  7. x = x + m
  8. return x, present
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement