Skip to content

[BUG Report]: Unable to use a mask with a GRU layer #1196

Open
@Utanapishtim31

Description

@Utanapishtim31

Description

In order to set a mask for a GRU layer, I must declare it with GRUOptionalArgs.Mask.
But the class GRUOptionalArgs does not implement the interface IOptionalArgs (probably an omission...), so it cannot be passed to GRU.Call() !

Please note that GRU.Call() checks for a GRUOptionalArgs and does not accept an RnnOptionalArgs.

Reproduction Steps

Try to compile the following code:

GRUArgs gruArgs = new GRUArgs();
gruArgs.Units = 100;
GRU rnnLayer = new GRU(gruArgs);

GRUOptionalArgs rnnOptionalArgs = new GRUOptionalArgs();
Tensors inputs = np.zeros(new Shape(1, 10, 5))

rnnLayer.Apply(inputs, optional_args: rnnOptionalArgs);

Known Workarounds

Use an LSTM ???

Configuration and Other Information

Tensorflow.NET 0.110.4
Tensorflow.Keras 0.11.4
.Net Framework 4.7.2
Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions