Skip to content

the shapes of input and output of glu function aret not consistent #17

Open
@softrime

Description

@softrime

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions