Skip to content

Add DropAxis transformer #89

@cboulay

Description

@cboulay

Some operations may yield a tensor where one of the dimensions is always length-1. e.g., PCA with n_components=1, or BandPower with only 1 band defined, or Slicer to select only 1 channel. It would be good to have a node that removed an axis. There are a couple ways to approach this.

  1. Squeeze out all Len-1 axes unless protected by a setting (e.g., iter_axis = "time" should not be dropped if we happen to get a single timestamp in a chunk).
  2. Only remove a single axis. If its length is > 1 we could choose to either select the first element or to raise an error.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions