Esempio n. 1
0
def test_copy():
    b = numpy.random.random((2, 3))
    a = afnumpy.array(b)
    c = afnumpy.copy(a)
    d = numpy.copy(b)
    a[:] = 0
    b[:] = 0
    iassert(c, d)
Esempio n. 2
0
 def conj(self):
     if not numpy.issubdtype(self.dtype, numpy.complex):
         return afnumpy.copy(self)
     if(self.d_array is not None):
         s = arrayfire.conjg(self.d_array)
         return ndarray(self.shape, dtype=pu.typemap(s.dtype()), af_array=s)
     else:
         return self.h_array.conj()
Esempio n. 3
0
def test_copy():
    b = numpy.random.random((2,3))
    a = afnumpy.array(b)
    c = afnumpy.copy(a)
    d = numpy.copy(b)
    a[:] = 0
    b[:] = 0
    iassert(c,d)
Esempio n. 4
0
 def conj(self):
     if not numpy.issubdtype(self.dtype, numpy.complex):
         return afnumpy.copy(self)
     s = arrayfire.conjg(self.d_array)
     return ndarray(self.shape, dtype=pu.typemap(s.dtype()), af_array=s)
Esempio n. 5
0
 def conj(self):
     if not numpy.issubdtype(self.dtype, numpy.complex):
         return afnumpy.copy(self)
     s = arrayfire.conjg(self.d_array)
     return ndarray(self.shape, dtype=pu.typemap(s.dtype()), af_array=s)