[Numpy-discussion] MemoryError with dot(A, A.T) where A is 800MB on 32-bit Vista
Xavier Saint-Mleux
saintmlx@apstat....
Wed Jun 9 12:26:15 CDT 2010
Alan G Isaac wrote:
> On 6/9/2010 12:49 PM, greg whittier wrote:
>
>> Is there a way to do A*A.T without two
>> copies of A?
>>
>
> Does this do what you want?
> Alan Isaac
>
>
>>>> a
>>>>
> array([[0, 1],
> [2, 3],
> [4, 5],
> [6, 7],
> [8, 9]])
>
>>>> np.tensordot(a,a,axes=(-1,-1))
>>>>
> array([[ 1, 3, 5, 7, 9],
> [ 3, 13, 23, 33, 43],
> [ 5, 23, 41, 59, 77],
> [ 7, 33, 59, 85, 111],
> [ 9, 43, 77, 111, 145]])
>
In my case, this still uses twice as much memory as should be needed,
just like using dot.
Xavier
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
More information about the NumPy-Discussion
mailing list