zdevito / ATen

ATen: A TENsor library for C++11
683 stars 125 forks source link

_type not properly initialized bin Tensor #205

Closed ivzhh closed 6 years ago

ivzhh commented 6 years ago

Hi all,

Recently I clone ATen and build ATen from scratch. I follow the common cmake convension and build ATen with VS 2015 x64. However, I start to use ATen in my project, compiling and linking are both successful, but statements like:

Tensor rc = CPU(kFloat).zeros({3,4});
Tensor rg = CUDA(kFloat).zeros({3,4});

Both rc and rg are not fully initialized. If I set rc[0][0] = 0.0f, or rg.fill_(0.0), I will get runtime error that _type in pimp of Tensor is 0x0000000000000000 or 0xffffffffffffffff. The execution failed.

I try to build with and without CUDA, or with many different commits, the problem persists.

Would you mind help me to identify which step I did not done correctly?

Thank you!