oseledets / TT-Toolbox

The git repository for the TT-Toolbox
Other
193 stars 73 forks source link

Add tt_broadcast(A, n_extra). Simillar to Numpy function 'numpy.broad… #53

Closed distone closed 4 years ago

distone commented 4 years ago

Add tt_broadcast(A, n_extra). Simillar to Numpy function 'numpy.broadcast_to', this function broadcast TT tensor A at extra dimensions with specified mode sizes. The function is useful at binary operations of two TT with different shapes. For example A.B with A shape (2,3) and B shape (2,3,4,5), we could firstly do A=tt_broadcast(A, [4,5]) to broadcast A to the same shape of B and do A.B.

dolgov commented 4 years ago

Is https://github.com/oseledets/TT-Toolbox/blob/master/%40tt_tensor/add_non_essential_dims.m doing the same? (A more general insertion broadcast in fact)

distone commented 4 years ago

oh, ok you are right. It is already there, and more general. thanks!

On Mon, 27 Jul 2020 at 16:37, dolgov notifications@github.com wrote:

Is https://github.com/oseledets/TT-Toolbox/blob/master/%40tt_tensor/add_non_essential_dims.m doing the same? (A more general insertion broadcast in fact)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/oseledets/TT-Toolbox/pull/53#issuecomment-664435305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6DMXYGODABKMWZVN34GX3R5WGJFANCNFSM4PIX75TA .