keras icon indicating copy to clipboard operation
keras copied to clipboard

[Contributors Wanted] Implement `compute_output_shape()` method for `MultiHeadAttention`

Open fchollet opened this issue 3 years ago • 2 comments

Nature of the task

Implement the method compute_output_shape() on the layer MultiHeadAttention. It should have the following signature:

def compute_output_shape(self, query_shape, value_shape, key_shape=None):

It should accept either TensorShape instances or tuples as shapes, and it should return a TensorShape instance.

Why?

The method is not required in order to use the layer, but it can be very useful to be able to compute the output shape of a layer without having to actually call it.

fchollet avatar Aug 27 '22 17:08 fchollet

I would like to take it if it is still available.

Pouyanpi avatar Aug 29 '22 10:08 Pouyanpi

@Pouyanpi thanks! Feel free to open a PR.

fchollet avatar Sep 01 '22 19:09 fchollet