Is there an “enhanced” numpy/scipy dot method?

前端 未结 3 1205
温柔的废话
温柔的废话 2020-12-24 12:45

Problem

I would like to compute the following using numpy or scipy:

Y = A**T * Q * A

where A is a m x n ma

3条回答
  •  Happy的楠姐
    2020-12-24 13:04

    I just wanted to put that up on SO, but this pull request should be helpful and remove the need for a separate function for numpy.dot https://github.com/numpy/numpy/pull/2730 This should be available in numpy 1.7

    In the meantime, I used the example above to write a function that can replace numpy dot, whatever the order of your arrays are, and make the right call to fblas.dgemm. http://pastebin.com/M8TfbURi

    Hope this helps,

提交回复
热议问题