You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the support for Permute layer is missing and it would be great if we could add support for this layer as well. The desired PR addressing this issue should include:
Implementation of layer class named as Permute (hint: you can use tf.linalg.transpose(...) for forward pass of this layer).
Documentation of layer.
Test cases
Support for export of layer to JSON (see ModelSaver.kt)
Support for import of layer from JSON (see ModelLoader.kt)
Hey @mkaze the Permute layer implementation in keras uses perm which is a tuple. While in the tf.linalg.transpose(...) perm needs to be of Operand<U extends Number> . I dont think we can typecast a tuple(IntArray) into Number(Int)?
@therealansh As far as I understand, all Operand values resolve in a Tensor and therefore the U in Operand<U> refers to the underlying datatype of each single element of Tensor (e.g. Float, Int, etc.).
So you can simply put the permutation in an IntArray and then use tf.constant, like tf.constant(permArray), to create an instance of Constant<Int> (which is a basically a subclass of Operand) and then pass it to transpose function.
Currently, the support for Permute layer is missing and it would be great if we could add support for this layer as well. The desired PR addressing this issue should include:
tf.linalg.transpose(...)
for forward pass of this layer).Also, if needed, you can take a look at Keras documentation for this layer.
The text was updated successfully, but these errors were encountered: