{"action":"closed","issue":{"url":"https://api.github.com/repos/twitter/torch-autograd/issues/38","labels_url":"https://api.github.com/repos/twitter/torch-autograd/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/twitter/torch-autograd/issues/38/comments","events_url":"https://api.github.com/repos/twitter/torch-autograd/issues/38/events","html_url":"https://github.com/twitter/torch-autograd/issues/38","id":118837569,"number":38,"title":"Batch matrix multplication","user":{"login":"ketranm","id":1192597,"avatar_url":"https://avatars.githubusercontent.com/u/1192597?v=3","gravatar_id":"","url":"https://api.github.com/users/ketranm","html_url":"https://github.com/ketranm","followers_url":"https://api.github.com/users/ketranm/followers","following_url":"https://api.github.com/users/ketranm/following{/other_user}","gists_url":"https://api.github.com/users/ketranm/gists{/gist_id}","starred_url":"https://api.github.com/users/ketranm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketranm/subscriptions","organizations_url":"https://api.github.com/users/ketranm/orgs","repos_url":"https://api.github.com/users/ketranm/repos","events_url":"https://api.github.com/users/ketranm/events{/privacy}","received_events_url":"https://api.github.com/users/ketranm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-25T13:33:34Z","updated_at":"2015-11-26T18:15:24Z","closed_at":"2015-11-26T18:15:24Z","body":"I'm using nn.MM for batch matrix multiplication but it I got an error in torch-autograd. Does torch-autograd support 3D Tensor multiplication at the current state?\r\n\r\nHere's is the example code I ran\r\n\r\n```lua\r\nlocal t = require 'torch'\r\nlocal d = require 'autograd'\r\n\r\nlocal mm = d.nn.MM(false, true)\r\n-- toy examples\r\nparams = {}\r\nparams.x = torch.randn(2,1,5)\r\nparams.y = torch.randn(2,3,5)\r\n\r\ntest = function(params)\r\n    local w = mm({params.x, params.y})\r\n    return t.sum(w)\r\nend\r\n\r\ndt = d(test)\r\ndparams, loss = dt(params)\r\nprint(loss)\r\n```\r\nAnd I got the following errors\r\n```\r\n/torch/install/share/lua/5.1/autograd/nnwrapper.lua:110: attempt to call method 'type' (a nil value)\r\nstack traceback:\r\n\t...etran/torch/install/share/lua/5.1/autograd/nnwrapper.lua:110: in function 'fun'\r\n\t...rch/install/share/lua/5.1/autograd/direct/DirectNode.lua:73: in function 'mm'\r\n\ttoy.lua:11: in function 'fun'\r\n\t...rch/install/share/lua/5.1/autograd/direct/DirectTape.lua:18: in function 'funOnly'\r\n\t...rch/install/share/lua/5.1/autograd/direct/DirectTape.lua:100: in function 'dt'\r\n\ttoy.lua:16: in main chunk\r\n\t[C]: in function 'dofile'\r\n\t...tran/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk\r\n\t[C]: at 0x010ec1b2d0\r\n```"}}