I don't think there is. But you can do one thing. Use tensorly for unfolding. Make a function that unfolds the input array. Then using that funtion make a lambda layer in keras or tf2.0 . Suppose you have input array X :
X = np.array([[[ 0, 1],
[ 2, 3],
[ 4, 5],
[ 6, 7]],
[[ 8, 9],
[10, 11],
[12, 13],
[14, 15]],
[[16, 17],
[18, 19],
[20, 21],
[22, 23]]])
To unfold a tensor, simply use the unfold function from TensorLy:
> from tensorly import unfold unfold(X, 0)
>> array([[ 0, 1, 2, 3, 4, 5, 6, 7],
[ 8, 9, 10, 11, 12, 13, 14, 15],
[16, 17, 18, 19, 20, 21, 22, 23]])
Now create a function that takes input array and returns unfolded
array
def unfold(X):
return unfold(X, 0)
Now use this function as a layer in keras
from keras.layers import Lambda
from keras.models import Sequential
model = Sequential()
model.add(....some_layer....)
model.add(....anotenter code hereher_layer....)
model.add(Lambda(unfold)) <<<<=== using our unfold function as keras layer
model.add(...more_layers..)
Hope this will help !