BooleanMask
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Methods
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.
|
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.
|
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. |
mask |
The mask to apply. |
options |
carries optional attributes values |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-11-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-11-29 UTC."],[],[],null,["# BooleanMask\n\npublic abstract class **BooleanMask** \n\n### Nested Classes\n\n|-------|---|---|----------------------------------------------------------------------------------------------|\n| class | [BooleanMask.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options) || Optional attributes for [BooleanMask](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask) |\n\n### Public Constructors\n\n|---|--------------------------------------------------------------------------------------|\n| | [BooleanMask](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask#BooleanMask())() |\n\n### Public Methods\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [BooleanMask.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options) | [axis](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask#axis(java.lang.Integer))(Integer axis) Used to indicate the axis to mask from. |\n| static [BooleanMask.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options) | [axis](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask#axis(int))(int axis) Used to indicate the axis to mask from. |\n| static \\\u003cT extends [TType](/jvm/api_docs/java/org/tensorflow/types/family/TType)\\\u003e [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e | [create](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask#create(org.tensorflow.op.Scope, org.tensorflow.Operand\u003cT\u003e, org.tensorflow.Operand\u003corg.tensorflow.types.TBool\u003e, org.tensorflow.op.core.BooleanMask.Options...))([Scope](/jvm/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e tensor, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TBool](/jvm/api_docs/java/org/tensorflow/types/TBool)\\\u003e mask, [Options...](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options) options) Apply boolean mask to tensor. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public\n**BooleanMask**\n()\n\n\u003cbr /\u003e\n\nPublic Methods\n--------------\n\n#### public static [BooleanMask.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options)\n**axis**\n(Integer axis)\n\nUsed to indicate the axis to mask from.\n`axis + dim(mask) \u003c= dim(tensor)` and `mask`'s shape must match\nthe first `axis + dim(mask)` dimensions of `tensor`'s shape. \n\n##### Parameters\n\n| axis | the axis to mask from. Uses 0 if null. |\n|------|----------------------------------------|\n\n#### public static [BooleanMask.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options)\n**axis**\n(int axis)\n\nUsed to indicate the axis to mask from.\n`axis + dim(mask) \u003c= dim(tensor)` and `mask`'s shape must match\nthe first `axis + dim(mask)` dimensions of `tensor`'s shape. \n\n##### Parameters\n\n| axis | the axis to mask from. |\n|------|------------------------|\n\n#### public static [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e\n**create**\n([Scope](/jvm/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e tensor, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003c[TBool](/jvm/api_docs/java/org/tensorflow/types/TBool)\\\u003e mask, [Options...](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMask.Options) options)\n\nApply boolean mask to tensor. Returns the flat array of each element corresponding to a `true` in the mask.\n\n\nNumpy equivalent is `tensor[mask]`.\n\n\nIn general, `0 \u003c dim(mask) = K \u003c= dim(tensor)`, and `mask`'s shape must match\nthe first K dimensions of `tensor`'s shape. We then have:\n`booleanMask(tensor, mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd]`\nwhere `(i1,...,iK)` is the ith `true` entry of `mask` (row-major order).\n\n\nThe `axis` could be used with `mask` to indicate the axis to mask from (it's 0 by default).\nIn that case, `axis + dim(mask) \u003c= dim(tensor)` and `mask`'s shape must match\nthe first `axis + dim(mask)` dimensions of `tensor`'s shape.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| tensor | The tensor to mask. |\n| mask | The mask to apply. |\n| options | carries optional attributes values |\n|---------|------------------------------------|\n\n##### Returns\n\n- The masked tensor."]]