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.

  • 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.