DALI icon indicating copy to clipboard operation
DALI copied to clipboard

Is there a function for chunking operations on numpy data?

Open 980202006 opened this issue 1 year ago • 3 comments

I want to split a single npy file read by fn.readers.numpy in 100-bit units according to the first dimension, is there any function available?

980202006 avatar Aug 05 '22 07:08 980202006

Hi @980202006,

Do you want to read only a window from the npy file? If so please check the following parameters of the numpy reader:

- rel_roi_end (float or list of float or TensorList of float, optional) –
  End of the region-of-interest, in relative coordinates (range [0.0 - 1.0]).
  This argument is incompatible with “roi_end”, “roi_shape” and “rel_roi_shape”.
- rel_roi_shape (float or list of float or TensorList of float, optional) –
  Shape of the region-of-interest, in relative coordinates (range [0.0 - 1.0]).
  This argument is incompatible with “roi_shape”, “roi_end” and “rel_roi_end”.
- rel_roi_start (float or list of float or TensorList of float, optional) –
  Start of the region-of-interest, in relative coordinates (range [0.0 - 1.0]).
  This argument is incompatible with “roi_start”.
- roi_axes (int or list of int, optional, default = []) –
  Order of dimensions used for the ROI anchor and shape argumens, as dimension indices.
  If not provided, all the dimensions should be specified in the ROI arguments.
-roi_end (int or list of int or TensorList of int, optional) –
  End of the region-of-interest, in absolute coordinates.
  This argument is incompatible with “rel_roi_end”, “roi_shape” and “rel_roi_shape”.
- roi_shape (int or list of int or TensorList of int, optional) –
  Shape of the region-of-interest, in absolute coordinates.
  This argument is incompatible with “rel_roi_shape”, “roi_end” and “rel_roi_end”.
- roi_start (int or list of int or TensorList of int, optional) –
  Start of the region-of-interest, in absolute coordinates.
  This argument is incompatible with “rel_roi_start”.

JanuszL avatar Aug 05 '22 07:08 JanuszL

I want to read multiple windows from a numpy file, like dividing a tensor into n equal parts.

980202006 avatar Aug 05 '22 07:08 980202006

The easiest solution would be to use the external source operator (especially parallel mode).

JanuszL avatar Aug 05 '22 08:08 JanuszL