holotomocupy.chunking

Functions:

gpu_batch

holotomocupy.chunking.gpu_batch(func)[source]

Decorator for processing data by chunks on GPU

Parameters
  • func (function for processing on GPU. The function should have syntax:)

  • [out1,out2,…] = func(in1, in2,.., par1,par2..), where

  • arrays in1,in2,.., out1,out2,.. have the same shape in the first dimension

  • treated as the dimension for chunking data processing on GPU. The func() should

  • perform processing on cupy arrays and return the result as a list of ndarray

  • or 1 ndarray.

  • Example

  • nn=180

  • a = np.zeros([nn,5,3])

  • b = np.zeros([nn,5,3,2])

  • def func(in1,in2,par) – out1 = in1+in2[:,0]*par out2 = in1+in2[:,1]*par return [out1,out2]