BooleanMaskUpdate
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 Constructors
public
BooleanMaskUpdate
()
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.
|
Whether to try broadcasting update. True by default.
Updates a tensor at the masked values, and returns the updated tensor. Does not mutate the input tensors. updates
will be broadcasted by default
Numpy equivalent is `tensor[mask] = updates`.
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.
The shape of updates
should be [n, t_1, t_2, ...]
where n
is the number of true values in
mask
and t_i
is the i
th dimension of tensor
after axis
and mask
.
updates
will be broadcasted to this shape by default, which can be disabled using options
.
Parameters
tensor |
The tensor to mask. |
mask |
The mask to apply. |
updates |
the new values |
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,["# BooleanMaskUpdate\n\npublic abstract class **BooleanMaskUpdate** \n\n### Nested Classes\n\n|-------|---|---|----------------------------------------------------------------------------------------------------------|\n| class | [BooleanMaskUpdate.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options) || Optional attributes for [BooleanMaskUpdate](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate) |\n\n### Public Constructors\n\n|---|--------------------------------------------------------------------------------------------------------|\n| | [BooleanMaskUpdate](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate#BooleanMaskUpdate())() |\n\n### Public Methods\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [BooleanMaskUpdate.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options) | [axis](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate#axis(java.lang.Integer))(Integer axis) Used to indicate the axis to mask from. |\n| static [BooleanMaskUpdate.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options) | [broadcast](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate#broadcast(java.lang.Boolean))(Boolean broadcast) Whether to try broadcasting update. |\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/BooleanMaskUpdate#create(org.tensorflow.op.Scope, org.tensorflow.Operand\u003cT\u003e, org.tensorflow.Operand\u003corg.tensorflow.types.TBool\u003e, org.tensorflow.Operand\u003cT\u003e, org.tensorflow.op.core.BooleanMaskUpdate.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, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e updates, [Options...](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options) options) Updates a tensor at the masked values, and returns the updated 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**BooleanMaskUpdate**\n()\n\n\u003cbr /\u003e\n\nPublic Methods\n--------------\n\n#### public static [BooleanMaskUpdate.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options)\n**axis**\n(Integer axis)\n\nUsed to indicate the axis to mask from. `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 [BooleanMaskUpdate.Options](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options)\n**broadcast**\n(Boolean broadcast)\n\nWhether to try broadcasting update. True by default. \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, [Operand](/jvm/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e updates, [Options...](/jvm/api_docs/java/org/tensorflow/op/core/BooleanMaskUpdate.Options) options)\n\nUpdates a tensor at the masked values, and returns the updated tensor. Does not mutate the input tensors. `updates` will be broadcasted by default\n\n\nNumpy equivalent is \\`tensor\\[mask\\] = updates\\`.\n\n\nIn general, `0 \u003c dim(mask) = K \u003c= dim(tensor)`, and `mask`'s shape must match the first K dimensions of\n`tensor`'s shape. We then have: `booleanMask(tensor, mask)[i, j1,...,jd] =\ntensor[i1,...,iK,j1,...,jd]` where `(i1,...,iK)` is the ith `true` entry of `mask` (row-major\norder).\n\n\nThe `axis` could be used with `mask` to indicate the axis to mask from (it's 0 by default). In that\ncase, `axis + dim(mask) \u003c= dim(tensor)` and `mask`'s shape must match the first `axis +\ndim(mask)` dimensions of `tensor`'s shape.\n\n\nThe shape of `updates` should be `[n, t_1, t_2, ...]` where `n` is the number of true values in\n`mask` and `t_i` is the `i`th dimension of `tensor` after `axis` and `mask`.\n`updates` will be broadcasted to this shape by default, which can be disabled using `options`.\n\n\u003cbr /\u003e\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| updates | the new values |\n| options | carries optional attributes values |\n|---------|------------------------------------|\n\n##### Returns\n\n- The masked tensor."]]