If that script works for you, then the numpy.dot() out argument will
work for you.  Note!  This is not a keyword argument.  Therefore the
following is wrong:

dot(a, b, out=c)

The following is correct:

dot(a, b, c)

You absolutely have to get the out argument working as, for large
arrays of high rank, this is one of the most important features of
numpy!

Regards,

Edward




On 15 June 2014 15:00, Edward d'Auvergne <[email protected]> wrote:
> Hi,
>
> Does the test script work
> (https://gna.org/support/download.php?file_id=21021)?  You should see
> the same matrix printed 3 times.
>
> Regards,
>
> Edward
>
> On 15 June 2014 14:57, Troels Emtekær Linnet <[email protected]> wrote:
>> Hi Edward.
>>
>> I have tried the "out" argument, but it wont work ???
>>
>> dot(A, B, out=C)
>> dot(C, A, out=C)
>> The C would evaluate to zero, if I use it both in function, and in the out.
>>
>> I dont know why!
>>
>>
>>
>> 2014-06-15 10:30 GMT+02:00 Edward d Auvergne
>> <[email protected]>:
>>
>>> Follow-up Comment #199, task #7807 (project relax):
>>>
>>> The following python script, to be placed in the base relax directory, and
>>> the
>>> corresponding log file, demonstrate the speed differences of various dot
>>> product operations.  This is to help make the numeric dispersion models
>>> faster.
>>>
>>> The script tests 3 different operations:
>>>
>>> 1) Sequential dot products (a = dot(b, c); a = dot(a, d)).
>>> 2) Chained dot products (a = b.dot(c).dot(d)).
>>> 3) Using the out argument to avoid memory allocation and garbage
>>> collection
>>> (dot(b, c, a); dot(a, d, a)).
>>>
>>> The timings are:
>>>
>>> 1) 3.71 s.
>>> 2) 4.05 s.
>>> 3) 1.99 s.
>>>
>>> As option 1) is the implementation used in the relax trunk, clearly option
>>> 3
>>> has the potential to significantly speed up the models.
>>>
>>>
>>> (file #21021, file #21022)
>>>     _______________________________________________________
>>>
>>> Additional Item Attachment:
>>>
>>> File name: dot_speed.py                   Size:2 KB
>>> File name: dot_speed.log                  Size:0 KB
>>>
>>>
>>>     _______________________________________________________
>>>
>>> Reply to this item at:
>>>
>>>   <http://gna.org/task/?7807>
>>>
>>> _______________________________________________
>>>   Message sent via/by Gna!
>>>   http://gna.org/
>>>
>>

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel

Reply via email to