cyclops-community / ctf

Cyclops Tensor Framework: parallel arithmetic on multidimensional arrays
Other
199 stars 53 forks source link

ctf.ones() initialize the tensor as all zeros when dtype is set #80

Closed yuchenpang closed 4 years ago

yuchenpang commented 4 years ago
import ctf
a = ctf.ones(2, dtype=float)
print(a) # array([0., 0.]) (should be array([1., 1.]))

a is initialized to all zeros by ctf.ones() if dtype is set to int, float, or complex, but it works correctly when dtype is set to None.