Skip to content

← tensor_math package

MoveAxisFirst

Move the given axis to the beginning of the list of axes.

Generally, data in NeuroPype is stored in multi-dimensional arrays (a.k.a. tensors), and these arrays have axes, such as space, time, frequency, instance, feature, and so on. These axes can generally be in any order, and nodes usually are robust to axis reorderings. However, some use cases may require some nodes to be reordered (see also ReorderAxes). The main use case for this node is when data has multiple axes of the same type, and a subsequent node shall be applied to a specific axis (e.g., one that is labelled with a particular custom label). Typically in such cases a node will simply act on the first axis of a given type (e.g., SelectRange), and by prepending this node prior to that operation, it is possible to pick a specific axis based on some criteria (currently involving the custom label), and make it the one that the next operation will act on. Version 1.0.0

Ports/Properties

data

Data to process.

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

axis

Axis type to select.

  • verbose name: Axis Type
  • default value: time
  • port type: ComboPort
  • value type: str (can be None)

memory_layout

Optionally the new memory layout of the data. The default keep will keep the original layout, which never incurs any copying and this is fastest. The 'linear' option will reorder the data into the best-fitting linear (contiguous) order (which may be either C or FORTRAN). The C option reorders the memory such that the elements in the last given axis lie closest to each other ('vary fastest' when stepping through memory) and the elements in the first axis are the farthest apart. The FOTRAN option is the opposite of the C option. Such reordering can improve the speed of the subsequent processing node(s), traded off by the cost of copying the data in this node.

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

label

Axis label. Optionally the label of the axis to move first. Note that you can also write time.blah to specify the time axis that has label "blah".

  • verbose name: Axis Label
  • default value: None
  • port type: StringPort
  • value type: str (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)