Exemplo 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)
Exemplo 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()
Exemplo 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)
Exemplo 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)
Exemplo 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)