Skip to content

← deep_learning package

BatchReshape

Reshape input tensor preserving the batch dimension.

This simplifies reshaping the input to a layer without having to explicitly preserve the batch dimension. Version 0.2.0

Ports/Properties

data

Data to process.

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

output_shape

Desired shape for the input tensor while preserving the first preserve_dims dimensions, given as a list of integers. If -1 is given for a dimension, the size is inferred from the input data. If the input data is a packet, then you can also specify the shape as a list of axis names (e.g., space, time, frequency, feature, axis) along with the special tokens singletonaxis, flattenedaxis, and ..., which stand for inserted singleton dimensions, flattened dimensions, and unspecified dimensions, respectively. The generic axis name "axis" can be used to refer to any axis in the input. Any named axes must be already present in the input data, and will be moved to the desired place; be aware that any flattened axes are by default of type Axis (i.e., they are not feature axes). If a plain integer shape is given, unspecific axes (of type axis) are generated. If last_as_feature is checked, then the last axis is made a feature axis regardless of what it was before. If plain array data is passed in, only integer shapes are supported, and the data is reshaped to the desired integer shape.

  • verbose name: Output Shape
  • default value: flattenedaxis
  • port type: ComboPort
  • value type: str (can be None)

last_as_feature

If True, the last axis of the output shape will be made a feature axis, regardless of what it was before. This only applies if packet data is provided.

  • verbose name: Last Axis As Feature
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

preserve_dims

Number of leading dimensions to preserve from the input shape. When using packet data as inputs, this will ensure that any instance axes are at the beginning of the data, and when left unspecified and will automatically preserve those axes; otherwise it will preserve the selected number of dimensions. For plain array inputs, this will instead default to 1, which preserves the usual leading batch dimension.

  • verbose name: Number Of Dimensions To Preserve
  • default value: None
  • port type: IntPort
  • value type: int (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)