Have a question? Connect with the community at the TensorFlow Forum

### Nested Classes

 class BooleanMask.Options Optional attributes for ``` BooleanMask ```

### Public Methods

 static BooleanMask.Options (Integer axis) Used to indicate the axis to mask from. static BooleanMask.Options (int axis) Used to indicate the axis to mask from. static Operand ( Scope scope, Operand tensor, Operand < TBool > mask, Options... options) Apply boolean mask to tensor.

## Public Methods

#### public static BooleanMask.Options axis (Integer axis)

Used to indicate the axis to mask from. ``` axis + dim(mask) <= dim(tensor) ``` and ``` mask ``` 's shape must match the first ``` axis + dim(mask) ``` dimensions of ``` tensor ``` 's shape.

##### Parameters
 axis the axis to mask from. Uses 0 if null.

#### public static BooleanMask.Options axis (int axis)

Used to indicate the axis to mask from. ``` axis + dim(mask) <= dim(tensor) ``` and ``` mask ``` 's shape must match the first ``` axis + dim(mask) ``` dimensions of ``` tensor ``` 's shape.

##### Parameters
 axis the axis to mask from.

#### public static Operand <T> create ( Scope scope, Operand <T> tensor, Operand < TBool > mask, Options... options)

Apply boolean mask to tensor. Returns the flat array of each element corresponding to a ``` true ``` in the mask.

Numpy equivalent is ``` tensor[mask] ``` .

In general, ``` 0 < dim(mask) = K <= dim(tensor) ``` , and ``` mask ``` 's shape must match the first K dimensions of ``` tensor ``` 's shape. We then have: ``` booleanMask(tensor, mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd] ``` where ``` (i1,...,iK) ``` is the ith ``` true ``` entry of ``` mask ``` (row-major order).

The ``` axis ``` could be used with ``` mask ``` to indicate the axis to mask from (it's 0 by default). In that case, ``` axis + dim(mask) <= dim(tensor) ``` and ``` mask ``` 's shape must match the first ``` axis + dim(mask) ``` dimensions of ``` tensor ``` 's shape.

##### Parameters
 tensor The tensor to mask. The mask to apply. carries optional attributes values