Skip to content

← utilities package

MoveToBackend

Move the data to the specified compute backend.

Any subsequent node that has a backend option will then by default use the same backend (i.e., the one specified here) without any conversion overhead. However, BEWARE that currently, most nodes will only work if the data is on the numpy backend (you will usually get crashes as a result). For this reason, the main use of this node is for the case where you run a chain of nodes that all have a backend option; in this case, you can first convert the data to the desired backend with this node, then run the chain of nodes, and then convert the data back to numpy before continuing with "regular" nodes. This avoids the unnecessary overhead of converting the data back and forth between numpy and your backend of choice in each of the nodes along that chain. Version 1.0.0

Ports/Properties

data

Data to process.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: object (can be None)
  • data direction: INOUT

backend

Compute backend to use. Keep means to keep the current backend. Numpy will force the data to NeuroPype's default numpy backend. Cupy is a fast GPU backend with very high numpy compatibility. Jax has nearly as good numpy compatibility as cupy, but is often a bit slower in most operations. Torch is often the fastest, but may not have all operations available. Torch-CPU runs on the CPU, but typically makes better use of multicore than Numpy (however, either of them will use no more cores than currently configured via, e.g., environment variables and context managers). TensorFlow is another fast GPU backend, but has at the time of this writing the lowest numpy compatibility. Dask is a multi-core CPU backend that aims to handle very large datasets. The remaining options are short-hand aliases.

  • verbose name: Backend
  • default value: numpy
  • port type: ComboPort
  • value type: str (can be None)

precision

Numeric precision to use. There is no difference between N-bit and floatN; these are just convenience aliases. Can be reduced to save memory (e.g. if running on GPU).

  • verbose name: Precision
  • default value: keep
  • port type: EnumPort
  • value type: str (can be None)

allow_markers

Allow processing of marker chunks, if any.

  • verbose name: Also Process Marker Stream
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

inconvertible

What to do if the data cannot be converted to the desired backend. Preserve will keep the affected piece of data on the current backend. Blank will replace the data with None. Raise will raise an exception.

  • verbose name: Inconvertible
  • default value: preserve
  • port type: EnumPort
  • value type: str (can be None)

recursive

Whether to recursively move all data in a nested structure. If False, only the top-level data will be moved, and if it is a list, it will be interpreted as an array.

  • verbose name: Recursive
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)