Open
Description
def glu(inputs):
'''Gated linear unit
Args:
inputs: A tensor of even dimensions. (N, Tx, 2c)
Returns:
outputs: A tensor of the same shape and dtype as inputs.
'''
a, b = tf.split(inputs, 2, -1) # (N, Tx, c) * 2
outputs = a * tf.nn.sigmoid(b)
return outputs
input shape is (N, Tx, 2c) while output shape should be (N, Tx, c)
I'm confused about consistent shapes of them.
Metadata
Metadata
Assignees
Labels
No labels