Skip to content

Utilities

zzjjbb edited this page Feb 18, 2021 · 3 revisions

ssnp.utils includes several useful utilities. They are used for specific purposes and do not rely on the main ssnp package (which means they can be used as stand-alone modules)

Data I/O

  • ssnp.read(source, dtype=None, shape=None, *, scale=1., gpu=True, pagelocked=False, **kwargs)

    Read data from source. The filetype is auto-detected by the file extension. Extra keyword parameters will be passed to the specific reader function.

    source: str

    Target file path

    dtype: compatible with numpy.dtype

    Specify data type of the elements of the resulting tensor

    shape: tuple

    Specify output shape when it cannot be decided. This can also be used to reshape the data.

    gpu: bool

    Whether load data to GPU device memory

    pagelocked: bool

    When gpu=False, whether allocate as CUDA pagelocked (pinned) memory

ssnp.utils.data

Clone this wiki locally