예제 #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)
예제 #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()
예제 #3
0
파일: test_lib.py 프로젝트: daurer/afnumpy
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)
예제 #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)
예제 #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)