Index based multiplication in Torch

10 views
Skip to first unread message

Mata Fu

unread,
Nov 15, 2017, 1:27:11 PM11/15/17
to torch7
I want to implement  Kronecker Product in torch from Matlab as follows. 

>> [X,Y] = meshgrid(1:112,1:64);
>> [j1,j2] = meshgrid(1:1,1:1);
>> a = linspace(1,112,112);
>> b = linspace(1,64,64);
>> c = a(j1,X).*b(j2,Y);

But I don't know how to write  c = a(j1,X).*b(j2,Y), which is a index based multiplication. 

Can someone help me?
Reply all
Reply to author
Forward
0 new messages