mratsim / Arraymancer

A fast, ergonomic and portable tensor library in Nim with a deep learning focus for CPU, GPU and embedded devices via OpenMP, Cuda and OpenCL backends
https://mratsim.github.io/Arraymancer/
Apache License 2.0
1.32k stars 95 forks source link

Elementwise operations #463

Open HumptyNumpty opened 3 years ago

HumptyNumpty commented 3 years ago

Hi,

I seem to be having difficulties with the element-wise operations, in particular the ==. operator. For any comparison operators postfixed with '.', the error message reads "undeclared identifier".

The `.==' operator works, but only for tensor to tensor comparisons. I cannot get any tensor to scalar comparisons to compute.

Installed via nimble, github pull, on nim-1.2.4.

Many thanks for your help

Example: nim> echo t >. int(1) Error: undeclared identifier: '>.'

nim> echo t Tensor[system.int] of shape [6]" on backend "Cpu" 0 1 2 3 4 5

Vindaar commented 3 years ago

I fear what's going on is that for some reason nimble still installed arraymancer version 0.5.2 for you instead of 0.6.0.

Can you check which version is installed? E.g. checking the path name via:

nimble path arraymancer

If that does indeed point to 0.5.2 you can workaround that for the time being by installing it via:

nimble install "arraymancer@#head"
HumptyNumpty commented 3 years ago

Many thanks - the path was indeed pointing to 0.5.2 and your workaround this has fixed the issue.