Skip to content

← tensor_math package

ReorderAxes

Reorder the axes in the given data.

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, in some rare cases a node might expect axes in a particular order (e.g., custom code). Besides Packets, this node can also be used with multidimensional arrays or lists of lists having a with regular top-level structure, to regroup items. Version 1.1.1

Ports/Properties

data

Data to process.

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

order

New axis order. Axes can be referenced by their type and/or name (i.e., 'space', or 'space.mylabel'), or by their index order (0, 1 etc.). The former is recommended since the exact order of the axes could be changed by previous nodes. This can formatted as a string (i.e., space, time, frequency), or as a list (or tuple) of strings. If referencing axes by type or name, two special symbols are allowed: ':' (one axis of any type) and '...' (zero or more axes of any type), i.e., :, time, .... Do not mix index and name references. WARNING: This parameter is not safe to expose on the network.

verbose name
New Order
default value
...
port type
Port
value type
object (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)

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)