aesara.tensor.compress

Contents

aesara.tensor.compress#

aesara.tensor.compress(condition, x, axis=None)[source]#

Return selected slices of an array along given axis.

It returns the input tensor, but with selected slices along a given axis retained. If no axis is provided, the tensor is flattened. Corresponds to numpy.compress

New in version 0.7.

Parameters:
  • condition – One dimensional array of non-zero and zero values corresponding to indices of slices along a selected axis.

  • x – Input data, tensor variable.

  • axis – The axis along which to slice.

Return type:

x with selected slices.