{"action":"closed","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/3507","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/3507/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/3507/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/3507/events","html_url":"https://github.com/fchollet/keras/issues/3507","id":171760756,"number":3507,"title":"Permuting 3D tensors causes \"You cannot drop a non-broadcastable dimension.\" error","user":{"login":"PiranjaF","id":9516330,"avatar_url":"https://avatars.githubusercontent.com/u/9516330?v=3","gravatar_id":"","url":"https://api.github.com/users/PiranjaF","html_url":"https://github.com/PiranjaF","followers_url":"https://api.github.com/users/PiranjaF/followers","following_url":"https://api.github.com/users/PiranjaF/following{/other_user}","gists_url":"https://api.github.com/users/PiranjaF/gists{/gist_id}","starred_url":"https://api.github.com/users/PiranjaF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiranjaF/subscriptions","organizations_url":"https://api.github.com/users/PiranjaF/orgs","repos_url":"https://api.github.com/users/PiranjaF/repos","events_url":"https://api.github.com/users/PiranjaF/events{/privacy}","received_events_url":"https://api.github.com/users/PiranjaF/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-17T21:08:13Z","updated_at":"2016-08-17T21:19:38Z","closed_at":"2016-08-17T21:19:38Z","body":"The Keras website has this simple example for using the Permute layer:\r\n\r\n```\r\nmodel = Sequential()\r\nmodel.add(Permute((2, 1), input_shape=(10, 64)))\r\n# now: model.output_shape == (None, 64, 10)\r\n# note: `None` is the batch dimension\r\n```\r\n\r\nThe issue is that I want to permute tensors of higher dimensionality (i.e. 3D tensors or 4D tensors). For instance, this is useful when connecting convolutional layers to recurrent layers in a specific type of architecture I'm investigating. However, if I try to permute a 3D tensor I get the following error:\r\n\r\n`ValueError: ('You cannot drop a non-broadcastable dimension.', ((False, False, False, False), (0, 2, 1)))`\r\n\r\nThis issue can be reproduced with the following code:\r\n\r\n```\r\nmodel = Sequential()\r\nmodel.add(Permute((2, 1), input_shape=(10, 64, 20)))\r\n```\r\n\r\nDoes anyone have an idea how I can fix this issue?"}}
{"actor":{"display_login":"PiranjaF"}}