code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
tensorflow_cpp tensorflow::ops::ExtractGlimpse tensorflow::ops::ExtractGlimpse
===============================
`#include <image_ops.h>`
Extracts a glimpse from the input tensor.
Summary
-------
Returns a set of windows called glimpses extracted at location `offsets` from the input tensor. If the windows only partially overlaps the inputs, the non overlapping areas will be filled with random noise.
The result is a 4-D tensor of shape `[batch_size, glimpse_height, glimpse_width, channels]`. The channels and batch dimensions are the same as that of the input tensor. The height and width of the output windows are specified in the `size` parameter.
The argument `normalized` and `centered` controls how the windows are built:
* If the coordinates are normalized but not centered, 0.0 and 1.0 correspond to the minimum and maximum of each height and width dimension.
* If the coordinates are both normalized and centered, they range from -1.0 to 1.0. The coordinates (-1.0, -1.0) correspond to the upper left corner, the lower right corner is located at (1.0, 1.0) and the center is at (0, 0).
* If the coordinates are not normalized they are interpreted as numbers of pixels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A 4-D float tensor of shape `[batch_size, height, width, channels]`.
* size: A 1-D tensor of 2 elements containing the size of the glimpses to extract. The glimpse height must be specified first, following by the glimpse width.
* offsets: A 2-D integer tensor of shape `[batch_size, 2]` containing the y, x locations of the center of each window.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)`):
* centered: indicates if the offset coordinates are centered relative to the image, in which case the (0, 0) offset is relative to the center of the input images. If false, the (0,0) offset corresponds to the upper left corner of the input images.
* normalized: indicates if the offset coordinates are normalized.
* uniform\_noise: indicates if the noise should be generated using a uniform distribution or a Gaussian distribution.
* noise: indicates if the noise should `uniform`, `gaussian`, or `zero`. The default is `uniform` which means the noise type will be decided by `uniform_noise`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor representing the glimpses `[batch_size, glimpse_height, glimpse_width, channels]`.
| Constructors and Destructors |
| --- |
| `[ExtractGlimpse](#classtensorflow_1_1ops_1_1_extract_glimpse_1ac8a9c699708b7ed7837cd2f6d9c5c960)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offsets)` |
| `[ExtractGlimpse](#classtensorflow_1_1ops_1_1_extract_glimpse_1a9e09f2f0c3cdc346a18adf000df718e9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offsets, const [ExtractGlimpse::Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[glimpse](#classtensorflow_1_1ops_1_1_extract_glimpse_1a07929fd965047271b887835daf6a62f0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_extract_glimpse_1ad83cc8bc3adacbbfa83216270c26afdf)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_extract_glimpse_1a2c22fcc3334291ced5542888967da833)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_extract_glimpse_1aa8739e3ce187260c8592ff8ee5365479)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_extract_glimpse_1a7e4ec40626bb935caf4f267647539c1e)() const` | |
| Public static functions |
| --- |
| `[Centered](#classtensorflow_1_1ops_1_1_extract_glimpse_1a1ae1ee7d233a8bb66ad6355cf707efb6)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` |
| `[Noise](#classtensorflow_1_1ops_1_1_extract_glimpse_1a9398870f40e6fb56cd7eabadb1be1320)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` |
| `[Normalized](#classtensorflow_1_1ops_1_1_extract_glimpse_1a96c9927ae4bfed46c286e1d1675ed973)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` |
| `[UniformNoise](#classtensorflow_1_1ops_1_1_extract_glimpse_1a9d8371a16ba771a5c114029dd2f5ee00)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ExtractGlimpse::Attrs](../../../struct/tensorflow/ops/extract-glimpse/attrs) | Optional attribute setters for [ExtractGlimpse](extract-glimpse#classtensorflow_1_1ops_1_1_extract_glimpse). |
Public attributes
-----------------
### glimpse
```
::tensorflow::Output glimpse
```
### operation
```
Operation operation
```
Public functions
----------------
### ExtractGlimpse
```
ExtractGlimpse(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input size,
::tensorflow::Input offsets
)
```
### ExtractGlimpse
```
ExtractGlimpse(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input size,
::tensorflow::Input offsets,
const ExtractGlimpse::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Centered
```
Attrs Centered(
bool x
)
```
### Noise
```
Attrs Noise(
StringPiece x
)
```
### Normalized
```
Attrs Normalized(
bool x
)
```
### UniformNoise
```
Attrs UniformNoise(
bool x
)
```
tensorflow_cpp tensorflow::ops::MapUnstageNoKey tensorflow::ops::MapUnstageNoKey
================================
`#include <data_flow_ops.h>`
Op removes and returns a random (key, value)
Summary
-------
from the underlying container. If the underlying container does not contain elements, the op will block until it does.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)` key
* `OutputList` values
| Constructors and Destructors |
| --- |
| `[MapUnstageNoKey](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1a218a5dd05739b2d21db3c6359d5fb19d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes)` |
| `[MapUnstageNoKey](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1a111220d31a42b8586a4579fb6cf24573)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes, const [MapUnstageNoKey::Attrs](../../../struct/tensorflow/ops/map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[key](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1a84ece028fa862be0cade6aad864db0e1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1a9f5ad16c66f2baee0ad3ccb1f9f96560)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1a54f92f2f4f631f7bd1a33ab90726e6b1)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1a34ad6a206eb1cdfcd29cafb1cacecffc)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1aa326385708b349dc1e5971ee79c6e3fb)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1aa7507fb3b685c595704ca708198ea661)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_unstage_no_key_1adb2bc647c524b2ad8c15684590acb723)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapUnstageNoKey::Attrs](../../../struct/tensorflow/ops/map-unstage-no-key/attrs) | Optional attribute setters for [MapUnstageNoKey](map-unstage-no-key#classtensorflow_1_1ops_1_1_map_unstage_no_key). |
Public attributes
-----------------
### key
```
::tensorflow::Output key
```
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### MapUnstageNoKey
```
MapUnstageNoKey(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
const DataTypeSlice & dtypes
)
```
### MapUnstageNoKey
```
MapUnstageNoKey(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
const DataTypeSlice & dtypes,
const MapUnstageNoKey::Attrs & attrs
)
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::MergeV2Checkpoints tensorflow::ops::MergeV2Checkpoints
===================================
`#include <io_ops.h>`
V2 format specific: merges the metadata files of sharded checkpoints.
Summary
-------
The
result is one logical checkpoint, with one physical metadata file and renamed data files.
Intended for "grouping" multiple checkpoints in a sharded checkpoint setup.
If delete\_old\_dirs is true, attempts to delete recursively the dirname of each path in the input checkpoint\_prefixes. This is useful when those paths are non user-facing temporary locations.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* checkpoint\_prefixes: prefixes of V2 checkpoints to merge.
* destination\_prefix: scalar. The desired final prefix. Allowed to be the same as one of the checkpoint\_prefixes.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/merge-v2-checkpoints/attrs#structtensorflow_1_1ops_1_1_merge_v2_checkpoints_1_1_attrs)`):
* delete\_old\_dirs: see above.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[MergeV2Checkpoints](#classtensorflow_1_1ops_1_1_merge_v2_checkpoints_1aa902c6451357a9d599c2c64f683945ed)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) checkpoint_prefixes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) destination_prefix)` |
| `[MergeV2Checkpoints](#classtensorflow_1_1ops_1_1_merge_v2_checkpoints_1ad1192c95172d80f30658cfadf2a90ba1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) checkpoint_prefixes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) destination_prefix, const [MergeV2Checkpoints::Attrs](../../../struct/tensorflow/ops/merge-v2-checkpoints/attrs#structtensorflow_1_1ops_1_1_merge_v2_checkpoints_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_merge_v2_checkpoints_1a01552fb0e89ef5dee73b9528d4c99733)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_merge_v2_checkpoints_1aa19e8785d4f1ff8d9a6dc401d078b5d6)() const` | |
| Public static functions |
| --- |
| `[DeleteOldDirs](#classtensorflow_1_1ops_1_1_merge_v2_checkpoints_1aacd19b816ee69eb23b3a8390b61a5fdc)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/merge-v2-checkpoints/attrs#structtensorflow_1_1ops_1_1_merge_v2_checkpoints_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MergeV2Checkpoints::Attrs](../../../struct/tensorflow/ops/merge-v2-checkpoints/attrs) | Optional attribute setters for [MergeV2Checkpoints](merge-v2-checkpoints#classtensorflow_1_1ops_1_1_merge_v2_checkpoints). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### MergeV2Checkpoints
```
MergeV2Checkpoints(
const ::tensorflow::Scope & scope,
::tensorflow::Input checkpoint_prefixes,
::tensorflow::Input destination_prefix
)
```
### MergeV2Checkpoints
```
MergeV2Checkpoints(
const ::tensorflow::Scope & scope,
::tensorflow::Input checkpoint_prefixes,
::tensorflow::Input destination_prefix,
const MergeV2Checkpoints::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### DeleteOldDirs
```
Attrs DeleteOldDirs(
bool x
)
```
tensorflow_cpp tensorflow::ops::Polygamma tensorflow::ops::Polygamma
==========================
`#include <math_ops.h>`
Compute the polygamma function \(\psi^{(n)}(x)\).
Summary
-------
The polygamma function is defined as:
\(\psi^{(a)}(x) = \frac{d^a}{dx^a} \psi(x)\)
where \(\psi(x)\) is the digamma function. The polygamma function is defined only for non-negative integer orders \
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Polygamma](#classtensorflow_1_1ops_1_1_polygamma_1a8734827b0854e48b3c194441b485263f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_polygamma_1a29dd3508dd733f881278f12ffb4ce7e1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_polygamma_1a2e9a68eb27378b2752fc5608c244a56a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_polygamma_1a7a35d6cbd50de815dc9fcb487f6a0b0b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_polygamma_1a8182fcd222adc4dd5b8163e80d307ddf)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_polygamma_1a650fcb3e26d60a217274b2cd8eadb10d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Polygamma
```
Polygamma(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::IsFinite tensorflow::ops::IsFinite
=========================
`#include <math_ops.h>`
Returns which elements of x are finite.
Summary
-------
(numpy) Equivalent to np.isfinite
Example:
```
x = tf.constant([5.0, 4.8, 6.8, np.inf, np.nan])
tf.math.is_finite(x) ==> [True, True, True, False, False]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[IsFinite](#classtensorflow_1_1ops_1_1_is_finite_1ac60abcd0aad5321f392e19933b709b6e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_is_finite_1a2433e7c92f4a91bbd0b51a0b989322cf)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_is_finite_1a94d3a3dcf40dfe8ea95dad27a980814e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_is_finite_1ad1105c74187f067142e83bb006359c15)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_is_finite_1a66fe18544e86f9c88454fb3a38763cdc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_is_finite_1a2bd03613260a76fd198717d87371e8d6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### IsFinite
```
IsFinite(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RandomShuffleQueue tensorflow::ops::RandomShuffleQueue
===================================
`#include <data_flow_ops.h>`
A queue that randomizes the order of elements.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* component\_types: The type of each component in a value.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)`):
* shapes: The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time.
* capacity: The upper bound on the number of elements in this queue. Negative numbers mean no limit.
* min\_after\_dequeue: Dequeue will block unless there would be this many elements after the dequeue or the queue is closed. This ensures a minimum level of mixing of elements.
* seed: If either seed or seed2 is set to be non-zero, the random number generator is seeded by the given seed. Otherwise, a random seed is used.
* seed2: A second seed to avoid seed collision.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this queue will be shared under the given name across multiple sessions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to the queue.
| Constructors and Destructors |
| --- |
| `[RandomShuffleQueue](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a9bccc69b7e3a13f4bb5d7323fd05ef6c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types)` |
| `[RandomShuffleQueue](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1ac7d64746531a706ec9376acd40b3a6ad)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types, const [RandomShuffleQueue::Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a29baf87a7c0accb04db35584eefbc430)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a15b6a2b2a78276af62a6e37fb3f25d8a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a61438811ad12bb57fb2a2d19f00a9189)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1acb4b0c5652b368664dd85dcc037d3c02)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1abb138edd572be65ba0192bf164347847)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a4413b1b2cb0ddee75d33f76663beeaaa)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1ad14fa9c08950c6c23b22fc601befd539)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| `[MinAfterDequeue](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a274e69d218da5754021b398f61c5bf1a)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a67af85647a9577958568a226754aab46)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1ae9697d776eb5643d3bf927ee56f4ca4c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| `[Shapes](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a8ca53d0b2e6ee989a88c2020e1fc0c08)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_random_shuffle_queue_1a6191f641c52c89e90b546d547834a02c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomShuffleQueue::Attrs](../../../struct/tensorflow/ops/random-shuffle-queue/attrs) | Optional attribute setters for [RandomShuffleQueue](random-shuffle-queue#classtensorflow_1_1ops_1_1_random_shuffle_queue). |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### RandomShuffleQueue
```
RandomShuffleQueue(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
```
### RandomShuffleQueue
```
RandomShuffleQueue(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types,
const RandomShuffleQueue::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MinAfterDequeue
```
Attrs MinAfterDequeue(
int64 x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
### Shapes
```
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseSplit tensorflow::ops::SparseSplit
============================
`#include <sparse_ops.h>`
Split a `SparseTensor` into `num_split` tensors along one dimension.
Summary
-------
If the `shape[split_dim]` is not an integer multiple of `num_split`. Slices `[0 : shape[split_dim] % num_split]` gets one extra dimension. For example, if `split_dim = 1` and `num_split = 2` and the input is
```
input_tensor = shape = [2, 7]
[ a d e ]
[b c ]
```
Graphically the output tensors are:
```
output_tensor[0] = shape = [2, 4]
[ a ]
[b c ]
output_tensor[1] = shape = [2, 3]
[ d e ]
[ ]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* split\_dim: 0-D. The dimension along which to split. Must be in the range `[0, rank(shape))`.
* indices: 2-D tensor represents the indices of the sparse tensor.
* values: 1-D tensor represents the values of the sparse tensor.
* shape: 1-D. tensor represents the shape of the sparse tensor. output indices: A list of 1-D tensors represents the indices of the output sparse tensors.
* num\_split: The number of ways to split.
Returns:
* `OutputList` output\_indices
* `OutputList` output\_values: A list of 1-D tensors represents the values of the output sparse tensors.
* `OutputList` output\_shape: A list of 1-D tensors represents the shape of the output sparse tensors.
| Constructors and Destructors |
| --- |
| `[SparseSplit](#classtensorflow_1_1ops_1_1_sparse_split_1a321e452a28531c13e1804a67073d0d86)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) split_dim, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, int64 num_split)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_split_1a2974c5fbf83913d7d9f9efaad3748136)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_split_1aa34695e1d3350589e31496300ce37439)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_split_1aaadf678ffb2ceae9b4a3a71e743c04e4)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_split_1a16af03b2decbe6d8c2b506f3e48dca4a)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::OutputList output_indices
```
### output\_shape
```
::tensorflow::OutputList output_shape
```
### output\_values
```
::tensorflow::OutputList output_values
```
Public functions
----------------
### SparseSplit
```
SparseSplit(
const ::tensorflow::Scope & scope,
::tensorflow::Input split_dim,
::tensorflow::Input indices,
::tensorflow::Input values,
::tensorflow::Input shape,
int64 num_split
)
```
tensorflow_cpp tensorflow::ops::ParseExampleV2 tensorflow::ops::ParseExampleV2
===============================
`#include <parsing_ops.h>`
Transforms a vector of tf.Example protos (as strings) into typed tensors.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A scalar or vector containing binary serialized Example protos.
* names: A tensor containing the names of the serialized protos. Corresponds 1:1 with the `serialized` tensor. May contain, for example, table key (descriptive) names for the corresponding serialized protos. These are purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no names are available. If non-empty, this tensor must have the same shape as "serialized".
* sparse\_keys: Vector of strings. The keys expected in the Examples' features associated with sparse values.
* dense\_keys: Vector of strings. The keys expected in the Examples' features associated with dense values.
* ragged\_keys: Vector of strings. The keys expected in the Examples' features associated with ragged values.
* dense\_defaults: A list of Tensors (some may be empty). Corresponds 1:1 with `dense_keys`. dense\_defaults[j] provides default values when the example's feature\_map lacks dense\_key[j]. If an empty [Tensor](../tensor#classtensorflow_1_1_tensor) is provided for dense\_defaults[j], then the Feature dense\_keys[j] is required. The input type is inferred from dense\_defaults[j], even when it's empty. If dense\_defaults[j] is not empty, and dense\_shapes[j] is fully defined, then the shape of dense\_defaults[j] must match that of dense\_shapes[j]. If dense\_shapes[j] has an undefined major dimension (variable strides dense feature), dense\_defaults[j] must contain a single element: the padding element.
* num\_sparse: The number of sparse keys.
* sparse\_types: A list of `num_sparse` types; the data types of data in each Feature given in sparse\_keys. Currently the [ParseExample](parse-example#classtensorflow_1_1ops_1_1_parse_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* ragged\_value\_types: A list of `num_ragged` types; the data types of data in each Feature given in ragged\_keys (where `num_ragged = sparse_keys.size()`). Currently the [ParseExample](parse-example#classtensorflow_1_1ops_1_1_parse_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* ragged\_split\_types: A list of `num_ragged` types; the data types of row\_splits in each Feature given in ragged\_keys (where `num_ragged = sparse_keys.size()`). May be DT\_INT32 or DT\_INT64.
* dense\_shapes: A list of `num_dense` shapes; the shapes of data in each Feature given in dense\_keys (where `num_dense = dense_keys.size()`). The number of elements in the Feature corresponding to dense\_key[j] must always equal dense\_shapes[j].NumEntries(). If dense\_shapes[j] == (D0, D1, ..., DN) then the shape of output [Tensor](../tensor#classtensorflow_1_1_tensor) dense\_values[j] will be (|serialized|, D0, D1, ..., DN): The dense outputs are just the inputs row-stacked by batch. This works for dense\_shapes[j] = (-1, D1, ..., DN). In this case the shape of the output [Tensor](../tensor#classtensorflow_1_1_tensor) dense\_values[j] will be (|serialized|, M, D1, .., DN), where M is the maximum number of blocks of elements of length D1 \* .... \* DN, across all minibatch entries in the input. [Any](any#classtensorflow_1_1ops_1_1_any) minibatch entry with less than M blocks of elements of length D1 \* ... \* DN will be padded with the corresponding default\_value scalar element along the second dimension.
Returns:
* `OutputList` sparse\_indices
* `OutputList` sparse\_values
* `OutputList` sparse\_shapes
* `OutputList` dense\_values
* `OutputList` ragged\_values
* `OutputList` ragged\_row\_splits
| Constructors and Destructors |
| --- |
| `[ParseExampleV2](#classtensorflow_1_1ops_1_1_parse_example_v2_1ab4e11094ad7703df99aa576d6ad67425)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) names, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ragged_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_defaults, int64 num_sparse, const DataTypeSlice & sparse_types, const DataTypeSlice & ragged_value_types, const DataTypeSlice & ragged_split_types, const gtl::ArraySlice< PartialTensorShape > & dense_shapes)` |
| Public attributes |
| --- |
| `[dense\_values](#classtensorflow_1_1ops_1_1_parse_example_v2_1a470bd99f28093905ebb2729aa4cedce6)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_parse_example_v2_1a514d8b2a197c9df22325d12a3b74a46f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[ragged\_row\_splits](#classtensorflow_1_1ops_1_1_parse_example_v2_1a295efa8fb5cdb697c1ebcef3906c9e78)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[ragged\_values](#classtensorflow_1_1ops_1_1_parse_example_v2_1a67d9cc60e2546f180462bf8f61299b41)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_indices](#classtensorflow_1_1ops_1_1_parse_example_v2_1a0c78755e58595fadb6b7989979fbd03e)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_example_v2_1a272ff8e836298c301eb6694d25fb070d)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_values](#classtensorflow_1_1ops_1_1_parse_example_v2_1a6b6a124a63884bcf1a02968c7caf0073)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
Public attributes
-----------------
### dense\_values
```
::tensorflow::OutputList dense_values
```
### operation
```
Operation operation
```
### ragged\_row\_splits
```
::tensorflow::OutputList ragged_row_splits
```
### ragged\_values
```
::tensorflow::OutputList ragged_values
```
### sparse\_indices
```
::tensorflow::OutputList sparse_indices
```
### sparse\_shapes
```
::tensorflow::OutputList sparse_shapes
```
### sparse\_values
```
::tensorflow::OutputList sparse_values
```
Public functions
----------------
### ParseExampleV2
```
ParseExampleV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input names,
::tensorflow::Input sparse_keys,
::tensorflow::Input dense_keys,
::tensorflow::Input ragged_keys,
::tensorflow::InputList dense_defaults,
int64 num_sparse,
const DataTypeSlice & sparse_types,
const DataTypeSlice & ragged_value_types,
const DataTypeSlice & ragged_split_types,
const gtl::ArraySlice< PartialTensorShape > & dense_shapes
)
```
tensorflow_cpp tensorflow::ops::ScaleAndTranslate tensorflow::ops::ScaleAndTranslate
==================================
`#include <image_ops.h>`
TODO: add doc.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The resized\_images tensor.
| Constructors and Destructors |
| --- |
| `[ScaleAndTranslate](#classtensorflow_1_1ops_1_1_scale_and_translate_1a5d744bf9e8aef0ad3b2c43623c3b46fd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) translation)` |
| `[ScaleAndTranslate](#classtensorflow_1_1ops_1_1_scale_and_translate_1aafff4ca50d2a442e0fac76c818f3f794)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) translation, const [ScaleAndTranslate::Attrs](../../../struct/tensorflow/ops/scale-and-translate/attrs#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scale_and_translate_1a40fb855bf86f1686bef818cc64334908)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[resized\_images](#classtensorflow_1_1ops_1_1_scale_and_translate_1a96e3d8165b33bec6667d607b3469b767)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scale_and_translate_1a9367f7f99d0ca92a91f5c0b622ea3f4a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scale_and_translate_1a492cfa6cc3bedfe90c8db8d87878f359)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scale_and_translate_1a572ec8c9917e9725d2f4892662f80fc9)() const` | |
| Public static functions |
| --- |
| `[Antialias](#classtensorflow_1_1ops_1_1_scale_and_translate_1ac8481acfa33cc082db5b8169640c0339)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scale-and-translate/attrs#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs)` |
| `[KernelType](#classtensorflow_1_1ops_1_1_scale_and_translate_1aa5372adaaf10db29e50328e030faf68d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/scale-and-translate/attrs#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScaleAndTranslate::Attrs](../../../struct/tensorflow/ops/scale-and-translate/attrs) | Optional attribute setters for [ScaleAndTranslate](scale-and-translate#classtensorflow_1_1ops_1_1_scale_and_translate). |
Public attributes
-----------------
### operation
```
Operation operation
```
### resized\_images
```
::tensorflow::Output resized_images
```
Public functions
----------------
### ScaleAndTranslate
```
ScaleAndTranslate(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
::tensorflow::Input scale,
::tensorflow::Input translation
)
```
### ScaleAndTranslate
```
ScaleAndTranslate(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
::tensorflow::Input scale,
::tensorflow::Input translation,
const ScaleAndTranslate::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Antialias
```
Attrs Antialias(
bool x
)
```
### KernelType
```
Attrs KernelType(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyAdam tensorflow::ops::ResourceApplyAdam
==================================
`#include <training_ops.h>`
Update '\*var' according to the Adam algorithm.
Summary
-------
$$\text{lr}\_t := \mathrm{lr} \cdot \frac{\sqrt{1 - \beta\_2^t} }{1 - \beta\_1^t}$$ $$m\_t := \beta\_1 \cdot m\_{t-1} + (1 - \beta\_1) \cdot g$$ $$v\_t := \beta\_2 \cdot v\_{t-1} + (1 - \beta\_2) \cdot g^2$$ $$\text{var} := \begin{cases} \text{var} - (m\_t \beta\_1 + g \cdot (1 - \beta\_1))\cdot\text{lr}\_t/(\sqrt{v\_t} + \epsilon), &\text{if use\_nesterov}\\ \text{var} - m\_t \cdot \text{lr}\_t /(\sqrt{v\_t} + \epsilon), &\text{otherwise} \end{cases}$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* v: Should be from a Variable().
* beta1\_power: Must be a scalar.
* beta2\_power: Must be a scalar.
* lr: Scaling factor. Must be a scalar.
* beta1: Momentum factor. Must be a scalar.
* beta2: Momentum factor. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-adam/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, uses the nesterov update.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyAdam](#classtensorflow_1_1ops_1_1_resource_apply_adam_1ac795afbdb2b0b71ee2d2de82cc60f117)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyAdam](#classtensorflow_1_1ops_1_1_resource_apply_adam_1ab1142d9fee53446380bed6cf6ffc3d16)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyAdam::Attrs](../../../struct/tensorflow/ops/resource-apply-adam/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_adam_1aabbba4cd6d62166c77e9ac3da3caa0bd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_adam_1aaf87aff51ef168ae2807151dccb08a18)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_adam_1a608016b3becbe65a6899bb3c0d4c1cf4)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adam/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_resource_apply_adam_1aa7ac09e230c73e3ee869c80a9eef764d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adam/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyAdam::Attrs](../../../struct/tensorflow/ops/resource-apply-adam/attrs) | Optional attribute setters for [ResourceApplyAdam](resource-apply-adam#classtensorflow_1_1ops_1_1_resource_apply_adam). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyAdam
```
ResourceApplyAdam(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input v,
::tensorflow::Input beta1_power,
::tensorflow::Input beta2_power,
::tensorflow::Input lr,
::tensorflow::Input beta1,
::tensorflow::Input beta2,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ResourceApplyAdam
```
ResourceApplyAdam(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input v,
::tensorflow::Input beta1_power,
::tensorflow::Input beta2_power,
::tensorflow::Input lr,
::tensorflow::Input beta1,
::tensorflow::Input beta2,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ResourceApplyAdam::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseCross tensorflow::ops::SparseCross
============================
`#include <sparse_ops.h>`
Generates sparse cross from a list of sparse and dense tensors.
Summary
-------
The op takes two lists, one of 2D `SparseTensor` and one of 2D `[Tensor](../tensor#classtensorflow_1_1_tensor)`, each representing features of one feature column. It outputs a 2D `SparseTensor` with the batchwise crosses of these features.
For example, if the inputs are
```
inputs[0]: SparseTensor with shape = [2, 2]
[0, 0]: "a"
[1, 0]: "b"
[1, 1]: "c"
inputs[1]: SparseTensor with shape = [2, 1]
[0, 0]: "d"
[1, 0]: "e"
inputs[2]: Tensor [["f"], ["g"]]
```
then the output will be
```
shape = [2, 2]
[0, 0]: "a_X_d_X_f"
[1, 0]: "b_X_e_X_g"
[1, 1]: "c_X_e_X_g"
```
if hashed\_output=true then the output will be
```
shape = [2, 2]
[0, 0]: FingerprintCat64(
Fingerprint64("f"), FingerprintCat64(
Fingerprint64("d"), Fingerprint64("a")))
[1, 0]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("b")))
[1, 1]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("c")))
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: 2-D. Indices of each input `SparseTensor`.
* values: 1-D. values of each `SparseTensor`.
* shapes: 1-D. Shapes of each `SparseTensor`.
* dense\_inputs: 2-D. Columns represented by dense `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* hashed\_output: If true, returns the hash of the cross instead of the string. This will allow us avoiding string manipulations.
* num\_buckets: It is used if hashed\_output is true. output = hashed\_valuenum\_buckets if num\_buckets > 0 else hashed\_value.
* hash\_key: Specify the hash\_key that will be used by the `FingerprintCat64` function to combine the crosses fingerprints.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. Indices of the concatenated `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. Non-empty values of the concatenated or hashed `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` output\_shape: 1-D. Shape of the concatenated `SparseTensor`.
| Constructors and Destructors |
| --- |
| `[SparseCross](#classtensorflow_1_1ops_1_1_sparse_cross_1aed8888154d0f2d69bb849055ef8805ae)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) shapes, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_inputs, bool hashed_output, int64 num_buckets, int64 hash_key, DataType out_type, DataType internal_type)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_cross_1aa80e22c2b5a8b8c00fdfbed5f6da6e03)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_cross_1aff3e5729686b249a84f3047cd2c7b2fa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_cross_1a168d4af0a9f32f170b7fd033550d0d24)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_cross_1a811794f95c743d1e8f345356e773447a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseCross
```
SparseCross(
const ::tensorflow::Scope & scope,
::tensorflow::InputList indices,
::tensorflow::InputList values,
::tensorflow::InputList shapes,
::tensorflow::InputList dense_inputs,
bool hashed_output,
int64 num_buckets,
int64 hash_key,
DataType out_type,
DataType internal_type
)
```
tensorflow_cpp tensorflow::ops::Rint tensorflow::ops::Rint
=====================
`#include <math_ops.h>`
Returns element-wise integer closest to x.
Summary
-------
If the result is midway between two representable values, the even representable is chosen. For example:
```
rint(-1.5) ==> -2.0
rint(0.5000001) ==> 1.0
rint([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) ==> [-2., -2., -0., 0., 2., 2., 2.]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Rint](#classtensorflow_1_1ops_1_1_rint_1a5d2ae5268db4697a1d6f07e9f38d9b5e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_rint_1aa7cf5e91f0540d21ba3ea3ba0e7b1c77)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_rint_1af8696ea336ceb7ec1c069eaca52f0cff)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_rint_1a5a265192cde844ea7d11e607d2efad1f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_rint_1a061fdd67e11dea6eebabcfc7104be78a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_rint_1a96e836c2f0393103c157bc89603ad7fb)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Rint
```
Rint(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AvgPool3DGrad tensorflow::ops::AvgPool3DGrad
==============================
`#include <nn_ops.h>`
Computes gradients of average pooling function.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* orig\_input\_shape: The original input dimensions.
* grad: [Output](../output#classtensorflow_1_1_output) backprop of shape `[batch, depth, rows, cols, channels]`.
* ksize: 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have `ksize[0] = ksize[4] = 1`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/avg-pool3-d-grad/attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_grad_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The backprop for input.
| Constructors and Destructors |
| --- |
| `[AvgPool3DGrad](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1ac294eebcd4d868dfa68e6a5f7d4c5ea9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[AvgPool3DGrad](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1a8362b0628d56d49ee76c24faaed842f9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [AvgPool3DGrad::Attrs](../../../struct/tensorflow/ops/avg-pool3-d-grad/attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1ac7d2ea5c42f4949a936e71f6debf81be)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1a9709fb2d31ca099ef81e317ecef40df8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1a30c25a58bfaad694e981cf0bbf407254)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1a4738d18b18c18a46d9f6d9c262df86a2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1ac991ec111bedce628daadef30690cd18)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_avg_pool3_d_grad_1aa9e0fbc35b1b72dd2e277ff5db79ca99)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/avg-pool3-d-grad/attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AvgPool3DGrad::Attrs](../../../struct/tensorflow/ops/avg-pool3-d-grad/attrs) | Optional attribute setters for [AvgPool3DGrad](avg-pool3-d-grad#classtensorflow_1_1ops_1_1_avg_pool3_d_grad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### AvgPool3DGrad
```
AvgPool3DGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input_shape,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### AvgPool3DGrad
```
AvgPool3DGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input_shape,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const AvgPool3DGrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Stage tensorflow::ops::Stage
======================
`#include <data_flow_ops.h>`
[Stage](stage#classtensorflow_1_1ops_1_1_stage) values similar to a lightweight Enqueue.
Summary
-------
The basic functionality of this Op is similar to a queue with many fewer capabilities and options. This Op is optimized for performance.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* values: a list of tensors dtypes A list of data types that inserted values should adhere to.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/stage/attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)`):
* capacity: [Maximum](maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached.
* memory\_limit: The maximum number of bytes allowed for Tensors in the Staging Area. If > 0, inserts will block until sufficient space is available.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: It is necessary to match this name to the matching [Unstage](unstage#classtensorflow_1_1ops_1_1_unstage) Op.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[Stage](#classtensorflow_1_1ops_1_1_stage_1a2e6dddeaa815c5474e05e750d6e386bd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values)` |
| `[Stage](#classtensorflow_1_1ops_1_1_stage_1a15dff0cc88976331c3c77a3cca8f8ac5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, const [Stage::Attrs](../../../struct/tensorflow/ops/stage/attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_stage_1a9b9eb57d3e297f80b61856f1b299118d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_stage_1ab21fa3ef760d64ed97217cb2121990c0)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_stage_1ac904517f73b2d8d7319ae4283f32b803)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage/attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_stage_1ad5b1a9624677491e271d10594f568223)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage/attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_stage_1af4e300d7df49830d41d0eba7b35d1ccd)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage/attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_stage_1a5a7ee7353ea1bc8416645b9e9568ce68)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage/attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Stage::Attrs](../../../struct/tensorflow/ops/stage/attrs) | Optional attribute setters for [Stage](stage#classtensorflow_1_1ops_1_1_stage). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### Stage
```
Stage(
const ::tensorflow::Scope & scope,
::tensorflow::InputList values
)
```
### Stage
```
Stage(
const ::tensorflow::Scope & scope,
::tensorflow::InputList values,
const Stage::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyFtrl tensorflow::ops::ResourceApplyFtrl
==================================
`#include <training_ops.h>`
Update '\*var' according to the Ftrl-proximal scheme.
Summary
-------
accum\_new = accum + grad \* grad linear += grad - (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyFtrl](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_1aad4d85a2e638469dbe3155f147f018c8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[ResourceApplyFtrl](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_1ae2f90848aff4185a26250531866329e0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [ResourceApplyFtrl::Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_1a0de68aae1932c1c4d5dcf3a839665558)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_1a602f7fb326f32fb3fe3101d65380b45d)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_1a7a892213f526ce2f5d1355c8d51e7cae)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_1a9acb1a5775d104b181717db97bf46f54)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyFtrl::Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl/attrs) | Optional attribute setters for [ResourceApplyFtrl](resource-apply-ftrl#classtensorflow_1_1ops_1_1_resource_apply_ftrl). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyFtrl
```
ResourceApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power
)
```
### ResourceApplyFtrl
```
ResourceApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power,
const ResourceApplyFtrl::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::PreventGradient tensorflow::ops::PreventGradient
================================
`#include <array_ops.h>`
An identity op that triggers an error if a gradient is requested.
Summary
-------
When executed in a graph, this op outputs its input tensor as-is.
When building ops to compute gradients, the TensorFlow gradient system will return an error when trying to lookup the gradient of this op, because no gradient must ever be registered for this function. This op exists to prevent subtle bugs from silently returning unimplemented gradients in some corner cases.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: any tensor.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/prevent-gradient/attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs)`):
* message: Will be printed in the error when anyone tries to differentiate this operation.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: the same input tensor.
| Constructors and Destructors |
| --- |
| `[PreventGradient](#classtensorflow_1_1ops_1_1_prevent_gradient_1a0b9966e0dc996fe02edcdfc60584d033)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[PreventGradient](#classtensorflow_1_1ops_1_1_prevent_gradient_1ae19edcd4e91e9dc4bc39684dfd8cfa74)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [PreventGradient::Attrs](../../../struct/tensorflow/ops/prevent-gradient/attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_prevent_gradient_1a9b6a878872406f077395172368112563)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_prevent_gradient_1a4c8f001d1b1f87090e63ed718977d582)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_prevent_gradient_1a039d4498a7fd50b84e4246f6adab399e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_prevent_gradient_1a20ebe0054ff4d6f2d7bb35242547bb7b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_prevent_gradient_1a2e068c7e108d2325da28edbfd997cd02)() const` | |
| Public static functions |
| --- |
| `[Message](#classtensorflow_1_1ops_1_1_prevent_gradient_1a5e4b110d0c0f8f247fd80301b88df40d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/prevent-gradient/attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::PreventGradient::Attrs](../../../struct/tensorflow/ops/prevent-gradient/attrs) | Optional attribute setters for [PreventGradient](prevent-gradient#classtensorflow_1_1ops_1_1_prevent_gradient). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### PreventGradient
```
PreventGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### PreventGradient
```
PreventGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const PreventGradient::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Message
```
Attrs Message(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::RealDiv tensorflow::ops::RealDiv
========================
`#include <math_ops.h>`
Returns x / y element-wise for real types.
Summary
-------
If `x` and `y` are reals, this will return the floating-point division.
*NOTE*: `[Div](div#classtensorflow_1_1ops_1_1_div)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[RealDiv](#classtensorflow_1_1ops_1_1_real_div_1a0a1cb47d726c4690b1b78ff188df4266)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_real_div_1a594562646d8385174f547d312f11b912)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_real_div_1a73b55789e737032c6d90bb85fc11413b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_real_div_1a762123de15f132a3651f72a05b7739e3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_real_div_1a80e9b7cb61763767e49c8a37a31424f7)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_real_div_1a4441ec4c87a20025dfabf0cb5f2afc96)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### RealDiv
```
RealDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StagePeek tensorflow::ops::StagePeek
==========================
`#include <data_flow_ops.h>`
Op peeks at the values at the specified index.
Summary
-------
If the
underlying container does not contain sufficient elements this op will block until it does. This Op is optimized for performance.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The values tensor.
| Constructors and Destructors |
| --- |
| `[StagePeek](#classtensorflow_1_1ops_1_1_stage_peek_1a90e49161f1d1a4010ba24e9019513ba0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) index, const DataTypeSlice & dtypes)` |
| `[StagePeek](#classtensorflow_1_1ops_1_1_stage_peek_1a079bd78fa4d20abab2bf8cab414e0add)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) index, const DataTypeSlice & dtypes, const [StagePeek::Attrs](../../../struct/tensorflow/ops/stage-peek/attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_stage_peek_1a0b59437504441cdc0350a0af35adc073)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_stage_peek_1ab81e49bd395b2bbfdfe24e803e1f5c84)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_stage_peek_1a9066a852de456497f6c8dcedf3cfa12e)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_stage_peek_1adb5968901c5db0b7c55efb3bac05d1b3)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage-peek/attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_stage_peek_1a2522cae0b1ad8807c5490702c8926bb2)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage-peek/attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_stage_peek_1a7f42c73b5bef5c87983f1f26ee678996)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage-peek/attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_stage_peek_1ad9ac94c8aceb869c00afc5e668ba1d68)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage-peek/attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StagePeek::Attrs](../../../struct/tensorflow/ops/stage-peek/attrs) | Optional attribute setters for [StagePeek](stage-peek#classtensorflow_1_1ops_1_1_stage_peek). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### StagePeek
```
StagePeek(
const ::tensorflow::Scope & scope,
::tensorflow::Input index,
const DataTypeSlice & dtypes
)
```
### StagePeek
```
StagePeek(
const ::tensorflow::Scope & scope,
::tensorflow::Input index,
const DataTypeSlice & dtypes,
const StagePeek::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseSegmentSumGrad tensorflow::ops::SparseSegmentSumGrad
=====================================
`#include <math_ops.h>`
Computes gradients for [SparseSegmentSum](sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum).
Summary
-------
Returns tensor "output" with same shape as grad, except for dimension 0 whose value is output\_dim0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* grad: gradient propagated to the [SparseSegmentSum](sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum) op.
* indices: indices passed to the corresponding [SparseSegmentSum](sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum) op.
* segment\_ids: segment\_ids passed to the corresponding [SparseSegmentSum](sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum) op.
* output\_dim0: dimension 0 of "data" passed to [SparseSegmentSum](sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum) op.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[SparseSegmentSumGrad](#classtensorflow_1_1ops_1_1_sparse_segment_sum_grad_1a2f50cd32d5ca3d8eaabebf1061af6e0a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) output_dim0)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_sum_grad_1a130e61afa77d187b3f1bddb32398d8ec)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_sum_grad_1a563cc642878c11f3fb99e282291e5f0e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_sum_grad_1a518179d518acf9a732521cd876593de1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_sum_grad_1afa09f14270f372ccbc2df770a4f51ebd)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_sum_grad_1a45a2513965a9c6f3d6f06540f172ed8d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentSumGrad
```
SparseSegmentSumGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input segment_ids,
::tensorflow::Input output_dim0
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::BarrierReadySize tensorflow::ops::BarrierReadySize
=================================
`#include <data_flow_ops.h>`
Computes the number of complete elements in the given barrier.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a barrier.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The number of complete elements (i.e. those with all of their value components set) in the barrier.
| Constructors and Destructors |
| --- |
| `[BarrierReadySize](#classtensorflow_1_1ops_1_1_barrier_ready_size_1a51121cc445185480d50dd40afb59bdfe)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_barrier_ready_size_1a474bcd8b228f5b0054819f67ad15bc3f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_barrier_ready_size_1a8895ef5e10a1cfd8b34031abd05970de)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_barrier_ready_size_1ac7cd96a76b2fdc0733c774daed43c7cf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_barrier_ready_size_1a45e85d5cb11f33f983c0c71132f7a57c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_barrier_ready_size_1a98f58ad93444e753301e6094c8ee72aa)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### BarrierReadySize
```
BarrierReadySize(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::LoopCond tensorflow::ops::LoopCond
=========================
`#include <control_flow_ops.h>`
Forwards the input to the output.
Summary
-------
This operator represents the loop termination condition used by the "pivot" switches of a loop.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A boolean scalar, representing the branch predicate of the [Switch](switch#classtensorflow_1_1ops_1_1_switch) op.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The same tensor as `input`.
| Constructors and Destructors |
| --- |
| `[LoopCond](#classtensorflow_1_1ops_1_1_loop_cond_1a6be8a0883ff88ab1db2ec0d77c01e519)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_loop_cond_1a5467aa1be24cfcdb0ec5b07284a7851c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_loop_cond_1a6cc2f2f893804a2e4c428cfb7dca231f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_loop_cond_1a62cad6af676919e5ab5c395339d5fc61)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_loop_cond_1ae3da575a834758e2d6cc5f6ac492cf74)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_loop_cond_1ac9bf4c84de74cbd17a2247902b420592)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### LoopCond
```
LoopCond(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseApplyCenteredRMSProp tensorflow::ops::SparseApplyCenteredRMSProp
===========================================
`#include <training_ops.h>`
Update '\*var' according to the centered RMSProp algorithm.
Summary
-------
The centered RMSProp algorithm uses an estimate of the centered second moment (i.e., the variance) for normalization, as opposed to regular RMSProp, which uses the (uncentered) second moment. This often helps with training, but is slightly more expensive in terms of computation and memory.
Note that in dense implementation of this algorithm, mg, ms, and mom will update even if the grad is zero, but in this sparse implementation, mg, ms, and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 mean\_grad = decay \* mean\_grad + (1-decay) \* gradient Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon - mean\_grad \*\* 2)
$$ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad$$ $$mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms + epsilon)$$ $$var <- var - mom$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* mg: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var, ms and mom.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1a306add3ddfecbb8c1c17a577e7545e18)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[SparseApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1a16ead662d87edcd1c60c7978723dbe5c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [SparseApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/sparse-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1a65849928c734bc61b5c2b280b499c580)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1a212e3ee046b968fe1e39437eb322295f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1afda472071705ded9acb97bdef672fe98)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1a33540e30f16d6e579d7f6dddc271d3e8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1afe37be981a644873b8b076eab5801804)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1a36f5242f1272ec92a4e3ad5a82574090)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/sparse-apply-centered-r-m-s-prop/attrs) | Optional attribute setters for [SparseApplyCenteredRMSProp](sparse-apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyCenteredRMSProp
```
SparseApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### SparseApplyCenteredRMSProp
```
SparseApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices,
const SparseApplyCenteredRMSProp::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::DebugGradientIdentity tensorflow::ops::DebugGradientIdentity
======================================
`#include <array_ops.h>`
[Identity](identity#classtensorflow_1_1ops_1_1_identity) op for gradient debugging.
Summary
-------
This op is hidden from public in Python. It is used by TensorFlow Debugger to register gradient tensors for gradient debugging. This op operates on non-reference-type tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[DebugGradientIdentity](#classtensorflow_1_1ops_1_1_debug_gradient_identity_1ae3e79fced5d715d7f38af712058878a2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_debug_gradient_identity_1ac50feb655f8db6b1b3abc3a975541c02)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_debug_gradient_identity_1a8ff48ede84e123195f610a0cfc9603e3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_debug_gradient_identity_1ae9c24f51bb5af1a8ace574e47158f07d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_debug_gradient_identity_1a17e3c6a7eb33b92bff5da952d50cba26)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_debug_gradient_identity_1a5e5ca81f6da9117ba4e4e72dae967f07)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DebugGradientIdentity
```
DebugGradientIdentity(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ResourceApplyCenteredRMSProp tensorflow::ops::ResourceApplyCenteredRMSProp
=============================================
`#include <training_ops.h>`
Update '\*var' according to the centered RMSProp algorithm.
Summary
-------
The centered RMSProp algorithm uses an estimate of the centered second moment (i.e., the variance) for normalization, as opposed to regular RMSProp, which uses the (uncentered) second moment. This often helps with training, but is slightly more expensive in terms of computation and memory.
Note that in dense implementation of this algorithm, mg, ms, and mom will update even if the grad is zero, but in this sparse implementation, mg, ms, and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 mean\_grad = decay \* mean\_grad + (1-decay) \* gradient
Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon - mean\_grad \*\* 2)
mg <- rho \* mg\_{t-1} + (1-rho) \* grad ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms - mg \* mg + epsilon) var <- var - mom
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* mg: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* momentum: Momentum Scale. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1ae565436d80eb32cdbfce3775392bbd51)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1a0ead23b65e0143295a16e541345e1327)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/resource-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1a8ab100432e06e5b4b39ec513e2bdb5c1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1ae0189191bdc3862abc5b5f8b7ddfbe7f)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1a3b73bc066177ec267dc5bfc7acb83998)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/resource-apply-centered-r-m-s-prop/attrs) | Optional attribute setters for [ResourceApplyCenteredRMSProp](resource-apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyCenteredRMSProp
```
ResourceApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ResourceApplyCenteredRMSProp
```
ResourceApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ResourceApplyCenteredRMSProp::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::SelectV2 tensorflow::ops::SelectV2
=========================
`#include <math_ops.h>`
TODO: add doc.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[SelectV2](#classtensorflow_1_1ops_1_1_select_v2_1a74a3b2fbc4a4c585b5abf1f946c690e2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) condition, ::[tensorflow::Input](../input#classtensorflow_1_1_input) t, ::[tensorflow::Input](../input#classtensorflow_1_1_input) e)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_select_v2_1a5e0204b5aa6fddff6e5dc6045e7eefcc)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_select_v2_1ac0e224b40c3b8e00ea682c57c5cd3ce7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_select_v2_1ab087c354cba808032d67d16ceed128a6)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_select_v2_1a0beeaf04d2d39cf4233c89f1989d6e40)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_select_v2_1ad02670f0130afc310731512434ccf90f)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SelectV2
```
SelectV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input condition,
::tensorflow::Input t,
::tensorflow::Input e
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Asinh tensorflow::ops::Asinh
======================
`#include <math_ops.h>`
Computes inverse hyperbolic sine of x element-wise.
Summary
-------
Given an input tensor, this function computes inverse hyperbolic sine for every element in the tensor. Both input and output has a range of `[-inf, inf]`.
```
x = tf.constant([-float("inf"), -2, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.asinh(x) ==> [-inf -1.4436355 -0.4812118 0.8813736 1.0159732 5.991471 9.903487 inf]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Asinh](#classtensorflow_1_1ops_1_1_asinh_1a696a66d4dcf2f72b2aa58d383c55447c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_asinh_1a46fc7566383616d830c1f1eac1b66aaf)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_asinh_1a0e58bd6b862e84425ee69c0e7c297392)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_asinh_1a5f5c1c01e8f872e8f15dd13144445544)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_asinh_1a1b3532f137d57c7ad08e9e437955467c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_asinh_1a1b075a1940c25b7854781c59b428727c)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Asinh
```
Asinh(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ReaderNumRecordsProduced tensorflow::ops::ReaderNumRecordsProduced
=========================================
`#include <io_ops.h>`
Returns the number of records this Reader has produced.
Summary
-------
This is the same as the number of [ReaderRead](reader-read#classtensorflow_1_1ops_1_1_reader_read) executions that have succeeded.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a Reader.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The records\_produced tensor.
| Constructors and Destructors |
| --- |
| `[ReaderNumRecordsProduced](#classtensorflow_1_1ops_1_1_reader_num_records_produced_1a69706bc3692ce65c0e6badac7f90c444)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reader_num_records_produced_1a0de0204aaf286d6987688c088c9b50fd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[records\_produced](#classtensorflow_1_1ops_1_1_reader_num_records_produced_1a44967afb2c88ee36fad51be9750335ad)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_reader_num_records_produced_1affaf4f4ac390d9d5552bdab27708fa00)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_reader_num_records_produced_1a1c800197db7e3d5e858055142bbc9e26)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_reader_num_records_produced_1af96e9ab110f854284965b0c4ccd81299)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### records\_produced
```
::tensorflow::Output records_produced
```
Public functions
----------------
### ReaderNumRecordsProduced
```
ReaderNumRecordsProduced(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::IsVariableInitialized tensorflow::ops::IsVariableInitialized
======================================
`#include <state_ops.h>`
Checks whether a tensor has been initialized.
Summary
-------
Outputs boolean scalar indicating whether the tensor has been initialized.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node. May be uninitialized.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The is\_initialized tensor.
| Constructors and Destructors |
| --- |
| `[IsVariableInitialized](#classtensorflow_1_1ops_1_1_is_variable_initialized_1a87a43164f781b7de92ab0823d3690a01)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref)` |
| Public attributes |
| --- |
| `[is\_initialized](#classtensorflow_1_1ops_1_1_is_variable_initialized_1a6b04d210b7237b4aaee54a3c45c99c41)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_is_variable_initialized_1ad7451f953a585b9bf007335930c6f930)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_is_variable_initialized_1ac5fbba3a4bc5e833b32bb936e0b683e2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_is_variable_initialized_1a29ebeb12023c9b9cde27be7762678de3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_is_variable_initialized_1afb0da459bb73412eaf8a43a4502ba69e)() const` | |
Public attributes
-----------------
### is\_initialized
```
::tensorflow::Output is_initialized
```
### operation
```
Operation operation
```
Public functions
----------------
### IsVariableInitialized
```
IsVariableInitialized(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApplyMomentum tensorflow::ops::ApplyMomentum
==============================
`#include <training_ops.h>`
Update '\*var' according to the momentum scheme.
Summary
-------
Set use\_nesterov = True if you want to use Nesterov momentum.
accum = accum \* momentum + grad var -= lr \* accum
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* grad: The gradient.
* momentum: Momentum. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-momentum/attrs#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyMomentum](#classtensorflow_1_1ops_1_1_apply_momentum_1a5049a3d6435e94f32d75072d46b2b6bf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum)` |
| `[ApplyMomentum](#classtensorflow_1_1ops_1_1_apply_momentum_1a8acb0c63affef19750579d082baf6761)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, const [ApplyMomentum::Attrs](../../../struct/tensorflow/ops/apply-momentum/attrs#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_momentum_1afeb55f0af37f433f53dc62116f0c8bf8)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_momentum_1adc714468dda0674aca4fa13fea935dcf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_momentum_1ab1bc1796db29a0f1d286b5270faa76c0)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_momentum_1a9d4224bb92da65979b204769d7359662)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_momentum_1a99975feb13b1eac6b8e4153e04b341bc)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_momentum_1a4a0957d092a63a28884f092dfe199e60)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-momentum/attrs#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_apply_momentum_1aafa34ce6f18e9d85f9aa7e5484b54496)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-momentum/attrs#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyMomentum::Attrs](../../../struct/tensorflow/ops/apply-momentum/attrs) | Optional attribute setters for [ApplyMomentum](apply-momentum#classtensorflow_1_1ops_1_1_apply_momentum). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyMomentum
```
ApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input momentum
)
```
### ApplyMomentum
```
ApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input momentum,
const ApplyMomentum::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseReduceMaxSparse tensorflow::ops::SparseReduceMaxSparse
======================================
`#include <sparse_ops.h>`
Computes the max of elements across dimensions of a SparseTensor.
Summary
-------
This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_max()`. In contrast to [SparseReduceMax](sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max), this Op returns a SparseTensor.
Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
If `reduction_axes` has no entries, all dimensions are reduced, and a tensor with a single element is returned. Additionally, the axes can be negative, which are interpreted according to the indexing rules in Python.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* input\_values: 1-D. `N` non-empty values corresponding to `input_indices`.
* input\_shape: 1-D. Shape of the input SparseTensor.
* reduction\_axes: 1-D. Length-`K` vector containing the reduction axes.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-max-sparse/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices
* `[Output](../output#classtensorflow_1_1_output)` output\_values
* `[Output](../output#classtensorflow_1_1_output)` output\_shape
| Constructors and Destructors |
| --- |
| `[SparseReduceMaxSparse](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1ae40de34c616688e6749e3d54974d7419)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes)` |
| `[SparseReduceMaxSparse](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1af854c14b3b0fa34f774983ea8a52a416)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes, const [SparseReduceMaxSparse::Attrs](../../../struct/tensorflow/ops/sparse-reduce-max-sparse/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1aa6cec252b1244bc6accbfdc68ffbc161)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1a2135d88c64b5f47d76d060420eb7b3a8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1a7ad897b2ce5a45a370c12f6f3c6209c3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1a2717637e81e732d547f2d1071c69b29f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1a89cffc8d5e0c99499f3404400168d979)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-max-sparse/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseReduceMaxSparse::Attrs](../../../struct/tensorflow/ops/sparse-reduce-max-sparse/attrs) | Optional attribute setters for [SparseReduceMaxSparse](sparse-reduce-max-sparse#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseReduceMaxSparse
```
SparseReduceMaxSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes
)
```
### SparseReduceMaxSparse
```
SparseReduceMaxSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes,
const SparseReduceMaxSparse::Attrs & attrs
)
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseAccumulatorTakeGradient tensorflow::ops::SparseAccumulatorTakeGradient
==============================================
`#include <data_flow_ops.h>`
Extracts the average sparse gradient in a [SparseConditionalAccumulator](sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator).
Summary
-------
The op will blocks until sufficient (i.e., more than num\_required) gradients have been accumulated. If the accumulator has already aggregated more than num\_required gradients, it will return its average of the accumulated gradients. Also automatically increments the recorded global\_step in the accumulator by 1, and resets the aggregate to 0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [SparseConditionalAccumulator](sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator).
* num\_required: Number of gradients required before we return an aggregate.
* dtype: The data type of accumulated gradients. Needs to correspond to the type of the accumulator.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` indices: Indices of the average of the accumulated sparse gradients.
* `[Output](../output#classtensorflow_1_1_output)` values: Values of the average of the accumulated sparse gradients.
* `[Output](../output#classtensorflow_1_1_output)` shape: Shape of the average of the accumulated sparse gradients.
| Constructors and Destructors |
| --- |
| `[SparseAccumulatorTakeGradient](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1a54dc667e3f29216b387adf94e4ef4e18)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_required, DataType dtype)` |
| Public attributes |
| --- |
| `[indices](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1aa27589031abec3face075eee8e143f70)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1a33f81e771ced8ac821e9176f8d8de2ef)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[shape](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1abaf43bc2f46333ed065180b5a922c901)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[values](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1a0aec4d550ca79eebbf67045528376cbf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### indices
```
::tensorflow::Output indices
```
### operation
```
Operation operation
```
### shape
```
::tensorflow::Output shape
```
### values
```
::tensorflow::Output values
```
Public functions
----------------
### SparseAccumulatorTakeGradient
```
SparseAccumulatorTakeGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input num_required,
DataType dtype
)
```
tensorflow_cpp tensorflow::ops::Less tensorflow::ops::Less
=====================
`#include <math_ops.h>`
Returns the truth value of (x < y) element-wise.
Summary
-------
*NOTE*: `[Less](less#classtensorflow_1_1ops_1_1_less)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Example:
```
x = tf.constant([5, 4, 6])
y = tf.constant([5])
tf.math.less(x, y) ==> [False, True, False]
```
```
x = tf.constant([5, 4, 6])
y = tf.constant([5, 6, 7])
tf.math.less(x, y) ==> [False, True, True]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Less](#classtensorflow_1_1ops_1_1_less_1ab29e80a426dd566eda4d0cf068627c66)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_less_1a13ea4db490972898e768d182b1594077)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_less_1aad05b61a5b81b5447da79dcf73db20bf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_less_1a872facf278b9a224f30faebe0c419f78)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_less_1ac62f2d3085c53bd78e79eed093c5b4e2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_less_1ae03cf5606cd0d42e1a35466743a2bf77)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Less
```
Less(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RGBToHSV tensorflow::ops::RGBToHSV
=========================
`#include <image_ops.h>`
Converts one or more images from RGB to HSV.
Summary
-------
Outputs a tensor of the same shape as the `images` tensor, containing the HSV value of the pixels. The output is only well defined if the value in `images` are in `[0,1]`.
`output[..., 0]` contains hue, `output[..., 1]` contains saturation, and `output[..., 2]` contains value. [All](all#classtensorflow_1_1ops_1_1_all) HSV values are in `[0,1]`. A hue of 0 corresponds to pure red, hue 1/3 is pure green, and 2/3 is pure blue.
Usage Example:
blue\_image = tf.stack([ ... tf.zeros([5,5]), ... tf.zeros([5,5]), ... tf.ones([5,5])], ... axis=-1) blue\_hsv\_image = tf.image.rgb\_to\_hsv(blue\_image) blue\_hsv\_image[0,0].numpy() array([0.6666667, 1. , 1. ], dtype=float32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 1-D or higher rank. RGB data to convert. Last dimension must be size 3.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: `images` converted to HSV.
| Constructors and Destructors |
| --- |
| `[RGBToHSV](#classtensorflow_1_1ops_1_1_r_g_b_to_h_s_v_1adeee02a3b49a0f5c65cb80d483ea989f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_r_g_b_to_h_s_v_1ac7ab2f00f74ab0311b9f1c48aaaf7eeb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_r_g_b_to_h_s_v_1a13c0fc88dc3e8e64b4d6e06b977dfb60)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_r_g_b_to_h_s_v_1a649b74b8b8eca61339a0b8697b48f663)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_r_g_b_to_h_s_v_1a8df89464d3f6495f95e0dacea72033dc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_r_g_b_to_h_s_v_1a985432c9b3b9e880080e1ec9c52a3d4a)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RGBToHSV
```
RGBToHSV(
const ::tensorflow::Scope & scope,
::tensorflow::Input images
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ParseExample tensorflow::ops::ParseExample
=============================
`#include <parsing_ops.h>`
Transforms a vector of brain.Example protos (as strings) into typed tensors.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A vector containing a batch of binary serialized Example protos.
* names: A vector containing the names of the serialized protos. May contain, for example, table key (descriptive) names for the corresponding serialized protos. These are purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no names are available. If non-empty, this vector must be the same length as "serialized".
* sparse\_keys: A list of Nsparse string Tensors (scalars). The keys expected in the Examples' features associated with sparse values.
* dense\_keys: A list of Ndense string Tensors (scalars). The keys expected in the Examples' features associated with dense values.
* dense\_defaults: A list of Ndense Tensors (some may be empty). dense\_defaults[j] provides default values when the example's feature\_map lacks dense\_key[j]. If an empty [Tensor](../tensor#classtensorflow_1_1_tensor) is provided for dense\_defaults[j], then the Feature dense\_keys[j] is required. The input type is inferred from dense\_defaults[j], even when it's empty. If dense\_defaults[j] is not empty, and dense\_shapes[j] is fully defined, then the shape of dense\_defaults[j] must match that of dense\_shapes[j]. If dense\_shapes[j] has an undefined major dimension (variable strides dense feature), dense\_defaults[j] must contain a single element: the padding element.
* sparse\_types: A list of Nsparse types; the data types of data in each Feature given in sparse\_keys. Currently the [ParseExample](parse-example#classtensorflow_1_1ops_1_1_parse_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* dense\_shapes: A list of Ndense shapes; the shapes of data in each Feature given in dense\_keys. The number of elements in the Feature corresponding to dense\_key[j] must always equal dense\_shapes[j].NumEntries(). If dense\_shapes[j] == (D0, D1, ..., DN) then the shape of output [Tensor](../tensor#classtensorflow_1_1_tensor) dense\_values[j] will be (|serialized|, D0, D1, ..., DN): The dense outputs are just the inputs row-stacked by batch. This works for dense\_shapes[j] = (-1, D1, ..., DN). In this case the shape of the output [Tensor](../tensor#classtensorflow_1_1_tensor) dense\_values[j] will be (|serialized|, M, D1, .., DN), where M is the maximum number of blocks of elements of length D1 \* .... \* DN, across all minibatch entries in the input. [Any](any#classtensorflow_1_1ops_1_1_any) minibatch entry with less than M blocks of elements of length D1 \* ... \* DN will be padded with the corresponding default\_value scalar element along the second dimension.
Returns:
* `OutputList` sparse\_indices
* `OutputList` sparse\_values
* `OutputList` sparse\_shapes
* `OutputList` dense\_values
| Constructors and Destructors |
| --- |
| `[ParseExample](#classtensorflow_1_1ops_1_1_parse_example_1abe97c3d8689593c4b7fc474df7232628)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) names, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) sparse_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_defaults, const DataTypeSlice & sparse_types, const gtl::ArraySlice< PartialTensorShape > & dense_shapes)` |
| Public attributes |
| --- |
| `[dense\_values](#classtensorflow_1_1ops_1_1_parse_example_1a0621ad91c166916f20c4d8d38da78674)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_parse_example_1a68504c285f005f993b30252db06fbee0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sparse\_indices](#classtensorflow_1_1ops_1_1_parse_example_1a9f9016a149620b00fad16bff88591905)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_example_1a39e169f2156ee03b9755c6e4b7bf9641)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_values](#classtensorflow_1_1ops_1_1_parse_example_1a39241716b69f84112f769ddf426c1a02)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
Public attributes
-----------------
### dense\_values
```
::tensorflow::OutputList dense_values
```
### operation
```
Operation operation
```
### sparse\_indices
```
::tensorflow::OutputList sparse_indices
```
### sparse\_shapes
```
::tensorflow::OutputList sparse_shapes
```
### sparse\_values
```
::tensorflow::OutputList sparse_values
```
Public functions
----------------
### ParseExample
```
ParseExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input names,
::tensorflow::InputList sparse_keys,
::tensorflow::InputList dense_keys,
::tensorflow::InputList dense_defaults,
const DataTypeSlice & sparse_types,
const gtl::ArraySlice< PartialTensorShape > & dense_shapes
)
```
tensorflow_cpp tensorflow::ops::MatchingFiles tensorflow::ops::MatchingFiles
==============================
`#include <io_ops.h>`
Returns the set of files matching one or more glob patterns.
Summary
-------
Note that this routine only supports wildcard characters in the basename portion of the pattern, not in the directory portion. Note also that the order of filenames returned is deterministic.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* pattern: Shell wildcard pattern(s). Scalar or vector of type string.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A vector of matching filenames.
| Constructors and Destructors |
| --- |
| `[MatchingFiles](#classtensorflow_1_1ops_1_1_matching_files_1a3e3c942e8a0843968d1a189f2ab5a115)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pattern)` |
| Public attributes |
| --- |
| `[filenames](#classtensorflow_1_1ops_1_1_matching_files_1a574b88c372b245758f76c5076e44bd4b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_matching_files_1a831e0f27aca8cc9752971631c78698b5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matching_files_1a48fe519714ade32291a2909d0085c3e8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matching_files_1aeee56e7318814b9310a87f3ef57344d8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matching_files_1a10e6abf5a58d531efcc8e4f74b78cc4b)() const` | |
Public attributes
-----------------
### filenames
```
::tensorflow::Output filenames
```
### operation
```
Operation operation
```
Public functions
----------------
### MatchingFiles
```
MatchingFiles(
const ::tensorflow::Scope & scope,
::tensorflow::Input pattern
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ShardedFilespec tensorflow::ops::ShardedFilespec
================================
`#include <io_ops.h>`
Generate a glob pattern matching all sharded file names.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The filename tensor.
| Constructors and Destructors |
| --- |
| `[ShardedFilespec](#classtensorflow_1_1ops_1_1_sharded_filespec_1aaef692cea51c5991ee6a0a7f85be2699)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) basename, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_shards)` |
| Public attributes |
| --- |
| `[filename](#classtensorflow_1_1ops_1_1_sharded_filespec_1ad51c5c583bf5eca2ed3046db452123d4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sharded_filespec_1a97e18b42afab10fa7fd3f98486087861)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sharded_filespec_1a5961eb03521a1631bc68f0c07ad6e21a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sharded_filespec_1a973f794c99a740277ae71bda13689169)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sharded_filespec_1a22c9e0549581e6cd4130dcb18d0e5fa0)() const` | |
Public attributes
-----------------
### filename
```
::tensorflow::Output filename
```
### operation
```
Operation operation
```
Public functions
----------------
### ShardedFilespec
```
ShardedFilespec(
const ::tensorflow::Scope & scope,
::tensorflow::Input basename,
::tensorflow::Input num_shards
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MaxPoolWithArgmax tensorflow::ops::MaxPoolWithArgmax
==================================
`#include <nn_ops.h>`
Performs max pooling on the input and outputs both max values and indices.
Summary
-------
The indices in `argmax` are flattened, so that a maximum value at position `[b, y, x, c]` becomes flattened index: `(y * width + x) * channels + c` if `include_batch_in_index` is False; `((b * height + y) * width + x) * channels + c` if `include_batch_in_index` is True.
The indices returned are always in `[0, height) x [0, width)` before flattening, even if padding is involved and the mathematically correct answer is outside (either negative or too large). This is a bug, but fixing it is difficult to do in a safe backwards compatible way, especially due to flattening.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, height, width, channels]`. [Input](../input#classtensorflow_1_1_input) to pool over.
* ksize: The size of the window for each dimension of the input tensor.
* strides: The stride of the sliding window for each dimension of the input tensor.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)`):
* include\_batch\_in\_index: Whether to include batch dimension in flattened index of `argmax`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output: The max pooled output tensor.
* `[Output](../output#classtensorflow_1_1_output)` argmax: 4-D. The flattened indices of the max values chosen for each output.
| Constructors and Destructors |
| --- |
| `[MaxPoolWithArgmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1abb51fa41db084247e489859748d89eec)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPoolWithArgmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a0c2a8005c65f80a0714ab13c31ac9b4a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPoolWithArgmax::Attrs](../../../struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[argmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a3ee6b2270133581582b335bb54c206cd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1ad70c7f4c8878ff933f05f49d914b32c5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1ae10e4e4c026e2fb47004e52ccae14cd5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[IncludeBatchInIndex](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a4e5f3eabc676bb9818da7a13ed74280d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)` |
| `[Targmax](#classtensorflow_1_1ops_1_1_max_pool_with_argmax_1a42ae4bbc217faf11615e6e2248886754)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPoolWithArgmax::Attrs](../../../struct/tensorflow/ops/max-pool-with-argmax/attrs) | Optional attribute setters for [MaxPoolWithArgmax](max-pool-with-argmax#classtensorflow_1_1ops_1_1_max_pool_with_argmax). |
Public attributes
-----------------
### argmax
```
::tensorflow::Output argmax
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPoolWithArgmax
```
MaxPoolWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPoolWithArgmax
```
MaxPoolWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPoolWithArgmax::Attrs & attrs
)
```
Public static functions
-----------------------
### IncludeBatchInIndex
```
Attrs IncludeBatchInIndex(
bool x
)
```
### Targmax
```
Attrs Targmax(
DataType x
)
```
tensorflow_cpp tensorflow::ops::EncodeJpeg tensorflow::ops::EncodeJpeg
===========================
`#include <image_ops.h>`
JPEG-encode an image.
Summary
-------
`image` is a 3-D uint8 [Tensor](../tensor#classtensorflow_1_1_tensor) of shape `[height, width, channels]`.
The attr `format` can be used to override the color format of the encoded output. Values can be:
* `''`: Use a default format based on the number of channels in the image. *`grayscale`: [Output](../output#classtensorflow_1_1_output) a grayscale JPEG image. The`channels`dimension of`image`must be 1. *`rgb`: [Output](../output#classtensorflow_1_1_output) an RGB JPEG image. The`channels`dimension of`image` must be 3.
If `format` is not specified or is the empty string, a default format is picked in function of the number of channels in `image`:
* 1: [Output](../output#classtensorflow_1_1_output) a grayscale image.
* 3: [Output](../output#classtensorflow_1_1_output) an RGB image.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* image: 3-D with shape `[height, width, channels]`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)`):
* format: Per pixel image format.
* quality: Quality of the compression from 0 to 100 (higher is better and slower).
* progressive: If True, create a JPEG that loads progressively (coarse to fine).
* optimize\_size: If True, spend CPU/RAM to reduce size with no quality change.
* chroma\_downsampling: See <http://en.wikipedia.org/wiki/Chroma_subsampling>.
* density\_unit: Unit used to specify `x_density` and `y_density`: pixels per inch (`'in'`) or centimeter (`'cm'`).
* x\_density: Horizontal pixels per density unit.
* y\_density: Vertical pixels per density unit.
* xmp\_metadata: If not empty, embed this XMP metadata in the image header.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 0-D. JPEG-encoded image.
| Constructors and Destructors |
| --- |
| `[EncodeJpeg](#classtensorflow_1_1ops_1_1_encode_jpeg_1a0ca40e89fe38209cf7585aa75db5253b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image)` |
| `[EncodeJpeg](#classtensorflow_1_1ops_1_1_encode_jpeg_1a79419850b6852e9fef1de27ccaeb02c9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image, const [EncodeJpeg::Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[contents](#classtensorflow_1_1ops_1_1_encode_jpeg_1a993f3e068d50550dccdee87eab14bf46)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_encode_jpeg_1a4a6ed1dc754ddbe8448db94af6b97903)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_encode_jpeg_1a184e73345337120296e192103c1faa1b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_encode_jpeg_1abb0cb093da0dd1edcd437b7a5a6a501e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_encode_jpeg_1a0b066a9fb1c91437f844cb0056d6bed9)() const` | |
| Public static functions |
| --- |
| `[ChromaDownsampling](#classtensorflow_1_1ops_1_1_encode_jpeg_1a955a859ac255af73650246c2be60efa6)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[DensityUnit](#classtensorflow_1_1ops_1_1_encode_jpeg_1aac4afe05ce09cebfce9f62e2b733243d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[Format](#classtensorflow_1_1ops_1_1_encode_jpeg_1a357af3801d374097cb3ab666711f727c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[OptimizeSize](#classtensorflow_1_1ops_1_1_encode_jpeg_1a363d3434cd5e13cfe6646e5297e55617)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[Progressive](#classtensorflow_1_1ops_1_1_encode_jpeg_1ad0bc11703455f6452e78d3e9290bfa30)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[Quality](#classtensorflow_1_1ops_1_1_encode_jpeg_1a8f272a8cab58219e417e67bad1538ee9)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[XDensity](#classtensorflow_1_1ops_1_1_encode_jpeg_1aaf12a81368799b401dbfa78b22eb2e0f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[XmpMetadata](#classtensorflow_1_1ops_1_1_encode_jpeg_1aba918bc2d45a12d7eee5dab85c56badb)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| `[YDensity](#classtensorflow_1_1ops_1_1_encode_jpeg_1a34fd19ec04cb0d7801aa09095585eb64)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::EncodeJpeg::Attrs](../../../struct/tensorflow/ops/encode-jpeg/attrs) | Optional attribute setters for [EncodeJpeg](encode-jpeg#classtensorflow_1_1ops_1_1_encode_jpeg). |
Public attributes
-----------------
### contents
```
::tensorflow::Output contents
```
### operation
```
Operation operation
```
Public functions
----------------
### EncodeJpeg
```
EncodeJpeg(
const ::tensorflow::Scope & scope,
::tensorflow::Input image
)
```
### EncodeJpeg
```
EncodeJpeg(
const ::tensorflow::Scope & scope,
::tensorflow::Input image,
const EncodeJpeg::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### ChromaDownsampling
```
Attrs ChromaDownsampling(
bool x
)
```
### DensityUnit
```
Attrs DensityUnit(
StringPiece x
)
```
### Format
```
Attrs Format(
StringPiece x
)
```
### OptimizeSize
```
Attrs OptimizeSize(
bool x
)
```
### Progressive
```
Attrs Progressive(
bool x
)
```
### Quality
```
Attrs Quality(
int64 x
)
```
### XDensity
```
Attrs XDensity(
int64 x
)
```
### XmpMetadata
```
Attrs XmpMetadata(
StringPiece x
)
```
### YDensity
```
Attrs YDensity(
int64 x
)
```
tensorflow_cpp tensorflow::ops::Digamma tensorflow::ops::Digamma
========================
`#include <math_ops.h>`
Computes Psi, the derivative of [Lgamma](lgamma#classtensorflow_1_1ops_1_1_lgamma) (the log of the absolute value of.
Summary
-------
`Gamma(x)`), element-wise.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Digamma](#classtensorflow_1_1ops_1_1_digamma_1a6182eb36e9babc7c2b8a3e7064e3d0f7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_digamma_1a34048a72ec86d1c8ece0b4a2218ad1a1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_digamma_1a1b4bfb0292bec2ac2d97cdba59e73b6f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_digamma_1a09892046f786ad16775f40a2855d1082)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_digamma_1a07f17ed2f95351b02ff17414a934d2e1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_digamma_1a4217e2d741be503d48e563cb60adcd84)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Digamma
```
Digamma(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyCenteredRMSProp tensorflow::ops::ResourceSparseApplyCenteredRMSProp
===================================================
`#include <training_ops.h>`
Update '\*var' according to the centered RMSProp algorithm.
Summary
-------
The centered RMSProp algorithm uses an estimate of the centered second moment (i.e., the variance) for normalization, as opposed to regular RMSProp, which uses the (uncentered) second moment. This often helps with training, but is slightly more expensive in terms of computation and memory.
Note that in dense implementation of this algorithm, mg, ms, and mom will update even if the grad is zero, but in this sparse implementation, mg, ms, and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 mean\_grad = decay \* mean\_grad + (1-decay) \* gradient Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon - mean\_grad \*\* 2)
ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms + epsilon) var <- var - mom
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* mg: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var, ms and mom.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1a13dce41e7458cfc667c93e6eb59c6b65)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[ResourceSparseApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1a52eb0f57f659a5ba696a88c140adcb50)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [ResourceSparseApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1a9e8632bd56dbebb4ae758e5db70e362e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1ab672a067b2ca695827a21dc01767c358)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1ab5163ae6d398ae1e0b22fd8f71091162)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop/attrs) | Optional attribute setters for [ResourceSparseApplyCenteredRMSProp](resource-sparse-apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyCenteredRMSProp
```
ResourceSparseApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### ResourceSparseApplyCenteredRMSProp
```
ResourceSparseApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices,
const ResourceSparseApplyCenteredRMSProp::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResourceScatterNdUpdate tensorflow::ops::ResourceScatterNdUpdate
========================================
`#include <state_ops.h>`
Applies sparse `updates` to individual values or slices within a given.
Summary
-------
variable according to `indices`.
`ref` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with rank `P` and `indices` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of `indices` (with length `K`) corresponds to indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th dimension of `ref`.
`updates` is `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q-1+P-K` with shape:
```
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].
```
For example, say we want to update 4 scattered elements to a rank-1 tensor to 8 elements. In Python, that update would look like this:
```
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
indices = tf.constant([[4], [3], [1] ,[7]])
updates = tf.constant([9, 10, 11, 12])
update = tf.scatter_nd_update(ref, indices, updates)
with tf.Session() as sess:
print sess.run(update)
```
The resulting update to ref would look like this:
```
[1, 11, 3, 10, 9, 6, 7, 12]
```
See `tf.scatter_nd` for more details about how to make updates to slices.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A resource handle. Must be from a VarHandleOp.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of updated values to add to ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-update/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_update_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceScatterNdUpdate](#classtensorflow_1_1ops_1_1_resource_scatter_nd_update_1a701849b468a1d765a8fa8ecf1820f464)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ResourceScatterNdUpdate](#classtensorflow_1_1ops_1_1_resource_scatter_nd_update_1a6f3373c4c7b0450a123c9ba20c4c116a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ResourceScatterNdUpdate::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-update/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_update_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_update_1a01f20b9b8778a7d8d62790ded4be2b87)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_update_1a34c9c3a28d29d52204c5232e44b0b7cf)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_scatter_nd_update_1aa18969344553eac87e406dad8ba84204)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-update/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_update_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceScatterNdUpdate::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-update/attrs) | Optional attribute setters for [ResourceScatterNdUpdate](resource-scatter-nd-update#classtensorflow_1_1ops_1_1_resource_scatter_nd_update). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceScatterNdUpdate
```
ResourceScatterNdUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ResourceScatterNdUpdate
```
ResourceScatterNdUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ResourceScatterNdUpdate::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyFtrl tensorflow::ops::ResourceSparseApplyFtrl
========================================
`#include <training_ops.h>`
Update relevant entries in '\*var' according to the Ftrl-proximal scheme.
Summary
-------
That is for rows we have grad for, we update var, accum and linear as follows: accum\_new = accum + grad \* grad linear += grad - (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyFtrl](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1aee900421c9006251c84f6dd00fb1892d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[ResourceSparseApplyFtrl](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1aca1e9533dccd71ef1217f5b21b2429ae)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [ResourceSparseApplyFtrl::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1a8c62c5bad64bbb58ad975e6e6d6e7510)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1ad6adcd76de214e2887864742642d04a9)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1a9e8c1263f133f89f71b593f96fdacb21)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1ad1edb0a2e7e8c453477bb22f82046f29)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyFtrl::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl/attrs) | Optional attribute setters for [ResourceSparseApplyFtrl](resource-sparse-apply-ftrl#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyFtrl
```
ResourceSparseApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power
)
```
### ResourceSparseApplyFtrl
```
ResourceSparseApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power,
const ResourceSparseApplyFtrl::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::BarrierClose tensorflow::ops::BarrierClose
=============================
`#include <data_flow_ops.h>`
Closes the given barrier.
Summary
-------
This operation signals that no more new elements will be inserted in the given barrier. Subsequent InsertMany that try to introduce a new key will fail. Subsequent InsertMany operations that just add missing components to already existing elements will continue to succeed. Subsequent TakeMany operations will continue to succeed if sufficient completed elements remain in the barrier. Subsequent TakeMany operations that would block will fail immediately.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a barrier.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/barrier-close/attrs#structtensorflow_1_1ops_1_1_barrier_close_1_1_attrs)`):
* cancel\_pending\_enqueues: If true, all pending enqueue requests that are blocked on the barrier's queue will be canceled. InsertMany will fail, even if no new key is introduced.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[BarrierClose](#classtensorflow_1_1ops_1_1_barrier_close_1aabb1e96c2ddec0a750259ec2e864f33f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| `[BarrierClose](#classtensorflow_1_1ops_1_1_barrier_close_1a34f077164e4cf9752ac97c5a4969a63e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, const [BarrierClose::Attrs](../../../struct/tensorflow/ops/barrier-close/attrs#structtensorflow_1_1ops_1_1_barrier_close_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_barrier_close_1a130fa096afe314a0ad50f3e66e7ee67f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_barrier_close_1a5af7233cd95d1c3e01481903033604b0)() const` | |
| Public static functions |
| --- |
| `[CancelPendingEnqueues](#classtensorflow_1_1ops_1_1_barrier_close_1ac01860430003fae988082eeb43ac543c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/barrier-close/attrs#structtensorflow_1_1ops_1_1_barrier_close_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BarrierClose::Attrs](../../../struct/tensorflow/ops/barrier-close/attrs) | Optional attribute setters for [BarrierClose](barrier-close#classtensorflow_1_1ops_1_1_barrier_close). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### BarrierClose
```
BarrierClose(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### BarrierClose
```
BarrierClose(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
const BarrierClose::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### CancelPendingEnqueues
```
Attrs CancelPendingEnqueues(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyAddSign tensorflow::ops::ResourceApplyAddSign
=====================================
`#include <training_ops.h>`
Update '\*var' according to the AddSign update.
Summary
-------
m\_t <- beta1 \* m\_{t-1} + (1 - beta1) \* g update <- (alpha + sign\_decay \* sign(g) \*sign(m)) \* g variable <- variable - lr\_t \* update
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* alpha: Must be a scalar.
* sign\_decay: Must be a scalar.
* beta: Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-add-sign/attrs#structtensorflow_1_1ops_1_1_resource_apply_add_sign_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyAddSign](#classtensorflow_1_1ops_1_1_resource_apply_add_sign_1a0537575d071b484d5dff692e05084ca7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyAddSign](#classtensorflow_1_1ops_1_1_resource_apply_add_sign_1aadd92ababa5fdbbad37d4375f29eb8dc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyAddSign::Attrs](../../../struct/tensorflow/ops/resource-apply-add-sign/attrs#structtensorflow_1_1ops_1_1_resource_apply_add_sign_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_add_sign_1a1cd2f7a0cc45a947807eafb75c32d002)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_add_sign_1a7f0642c4cf6e69cc96b4102b61504f26)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_add_sign_1a9303912bb40b03efeb6f25dc94cb1de5)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-add-sign/attrs#structtensorflow_1_1ops_1_1_resource_apply_add_sign_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyAddSign::Attrs](../../../struct/tensorflow/ops/resource-apply-add-sign/attrs) | Optional attribute setters for [ResourceApplyAddSign](resource-apply-add-sign#classtensorflow_1_1ops_1_1_resource_apply_add_sign). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyAddSign
```
ResourceApplyAddSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input alpha,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad
)
```
### ResourceApplyAddSign
```
ResourceApplyAddSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input alpha,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad,
const ResourceApplyAddSign::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Merge tensorflow::ops::Merge
======================
`#include <control_flow_ops.h>`
Forwards the value of an available tensor from `inputs` to `output`.
Summary
-------
`[Merge](merge#classtensorflow_1_1ops_1_1_merge)` waits for at least one of the tensors in `inputs` to become available. It is usually combined with `[Switch](switch#classtensorflow_1_1ops_1_1_switch)` to implement branching.
`[Merge](merge#classtensorflow_1_1ops_1_1_merge)` forwards the first tensor to become available to `output`, and sets `value_index` to its index in `inputs`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* inputs: The input tensors, exactly one of which will become available.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output: Will be set to the available input tensor.
* `[Output](../output#classtensorflow_1_1_output)` value\_index: The index of the chosen input tensor in `inputs`.
| Constructors and Destructors |
| --- |
| `[Merge](#classtensorflow_1_1ops_1_1_merge_1a72704c3d1bf64aedb9bd82724f228c2a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_merge_1a3c9561c2129cfb34d16e93ebf40f9b73)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_merge_1ab0c85516a5cbe032d96abc1064a8fd9e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[value\_index](#classtensorflow_1_1ops_1_1_merge_1a354d34167c730ae8b9acf23087558904)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
### value\_index
```
::tensorflow::Output value_index
```
Public functions
----------------
### Merge
```
Merge(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::LMDBReader tensorflow::ops::LMDBReader
===========================
`#include <io_ops.h>`
A Reader that outputs the records from a LMDB file.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/l-m-d-b-reader/attrs#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs)`):
* container: If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to reference the Reader.
| Constructors and Destructors |
| --- |
| `[LMDBReader](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1aba54e0a78f2c2adc405be27575843dda)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| `[LMDBReader](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1a0a7c31411c2b5e528dac6c6718918f54)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const [LMDBReader::Attrs](../../../struct/tensorflow/ops/l-m-d-b-reader/attrs#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1a8550db7ffa81c7511736fee76be9805b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reader\_handle](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1a2ec9ea5cf1f496e2941cd20382c573dd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1ac0a269c6f6f9f019f7d3f8587c96e684)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1a317ffe2fd10b77168151dba3e9ff8cd9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1a9e30025354dd177fee5e0964e49c3575)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1ae5b41e1b88bf89e168cb16b4884cca9c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/l-m-d-b-reader/attrs#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_l_m_d_b_reader_1ad7033810095bfd816aaae5ab3e8d3cfb)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/l-m-d-b-reader/attrs#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::LMDBReader::Attrs](../../../struct/tensorflow/ops/l-m-d-b-reader/attrs) | Optional attribute setters for [LMDBReader](l-m-d-b-reader#classtensorflow_1_1ops_1_1_l_m_d_b_reader). |
Public attributes
-----------------
### operation
```
Operation operation
```
### reader\_handle
```
::tensorflow::Output reader_handle
```
Public functions
----------------
### LMDBReader
```
LMDBReader(
const ::tensorflow::Scope & scope
)
```
### LMDBReader
```
LMDBReader(
const ::tensorflow::Scope & scope,
const LMDBReader::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseConditionalAccumulator tensorflow::ops::SparseConditionalAccumulator
=============================================
`#include <data_flow_ops.h>`
A conditional accumulator for aggregating sparse gradients.
Summary
-------
The accumulator accepts gradients marked with local\_step greater or equal to the most recent global\_step known to the accumulator. The average can be extracted from the accumulator, provided sufficient gradients have been accumulated. Extracting the average automatically resets the aggregate to 0, and increments the global\_step recorded by the accumulator.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* dtype: The type of the value being accumulated.
* shape: The shape of the values.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)`):
* container: If non-empty, this accumulator is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this accumulator will be shared under the given name across multiple sessions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to the accumulator.
| Constructors and Destructors |
| --- |
| `[SparseConditionalAccumulator](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1a4133d47c6e15c4a9aeefec18ecdcec8e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype, PartialTensorShape shape)` |
| `[SparseConditionalAccumulator](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1accae7d9bc21410b017b23f3274a9bb5c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype, PartialTensorShape shape, const [SparseConditionalAccumulator::Attrs](../../../struct/tensorflow/ops/sparse-conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1ae254a334398940972605109db3c7954d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1ad8d5c853cb09f54c21878ddca9b9f600)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1aba524ddfd366dcef3f9dd99bcb7b5c7d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1a5e355e5910304b5edd44ef6a51abd472)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1a39a61597615354b5d7b73dd9a23cdc8b)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1a1600abd8fa3fea5d2d36ccd67de401c7)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)` |
| `[ReductionType](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1a280e4c1312be92c2d72875d9cbb6bb80)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1aa7defbdbb0837b0af6dc7fb714603e50)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseConditionalAccumulator::Attrs](../../../struct/tensorflow/ops/sparse-conditional-accumulator/attrs) | Optional attribute setters for [SparseConditionalAccumulator](sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator). |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### SparseConditionalAccumulator
```
SparseConditionalAccumulator(
const ::tensorflow::Scope & scope,
DataType dtype,
PartialTensorShape shape
)
```
### SparseConditionalAccumulator
```
SparseConditionalAccumulator(
const ::tensorflow::Scope & scope,
DataType dtype,
PartialTensorShape shape,
const SparseConditionalAccumulator::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### ReductionType
```
Attrs ReductionType(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Prod tensorflow::ops::Prod
=====================
`#include <math_ops.h>`
Computes the product of elements across dimensions of a tensor.
Summary
-------
Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The tensor to reduce.
* axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/prod/attrs#structtensorflow_1_1ops_1_1_prod_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor.
Aliases:
* ReduceProd
| Constructors and Destructors |
| --- |
| `[Prod](#classtensorflow_1_1ops_1_1_prod_1a29b256476990c7cae35fac4f60058d74)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[Prod](#classtensorflow_1_1ops_1_1_prod_1acef934b4655671a548f08b61cc12ff40)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Prod::Attrs](../../../struct/tensorflow/ops/prod/attrs#structtensorflow_1_1ops_1_1_prod_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_prod_1ac0d39f84b4d4203b6b9298471f79fcb0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_prod_1a637cd7559f207583c5833a4b2e4fbdd5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_prod_1a5d7164d3fe0e3836e18d424e98dc1b27)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_prod_1a88ec74f3d3ad9bdf6c9adacb5666063b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_prod_1acf8469d69e8eb65e2a1a248f16a30015)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_prod_1a4e345cf4be9273e418f3b64ca5a52a7a)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/prod/attrs#structtensorflow_1_1ops_1_1_prod_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Prod::Attrs](../../../struct/tensorflow/ops/prod/attrs) | Optional attribute setters for [Prod](prod#classtensorflow_1_1ops_1_1_prod). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Prod
```
Prod(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis
)
```
### Prod
```
Prod(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis,
const Prod::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::NonMaxSuppression tensorflow::ops::NonMaxSuppression
==================================
`#include <image_ops.h>`
Greedily selects a subset of bounding boxes in descending order of score,.
Summary
-------
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system. Note that this algorithm is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected\_indices = tf.image.non\_max\_suppression( boxes, scores, max\_output\_size, iou\_threshold) selected\_boxes = tf.gather(boxes, selected\_indices)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* boxes: A 2-D float tensor of shape `[num_boxes, 4]`.
* scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).
* max\_output\_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs)`):
* iou\_threshold: A float representing the threshold for deciding whether boxes overlap too much with respect to IOU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
| Constructors and Destructors |
| --- |
| `[NonMaxSuppression](#classtensorflow_1_1ops_1_1_non_max_suppression_1a9d86b1cd20b43d62327b4b497d6457d4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size)` |
| `[NonMaxSuppression](#classtensorflow_1_1ops_1_1_non_max_suppression_1a1ab4c9ad2a00fb51e1dfd72bc9fc363b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, const [NonMaxSuppression::Attrs](../../../struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_non_max_suppression_1a1959f5a68ba6d16064a93d86a1414712)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[selected\_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_1ad4219ad3203cc7d4d8c96f8833d367fc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_non_max_suppression_1a4cad107f2f05bbb87deb2241ecad5f6e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_1af7a9dd9e033cacef4e2771bdf3998725)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_1acb3c005a4bed5fc05b4eaae70457faca)() const` | |
| Public static functions |
| --- |
| `[IouThreshold](#classtensorflow_1_1ops_1_1_non_max_suppression_1a136de54e18cc497fc70fc94659efd6ae)(float x)` | `[Attrs](../../../struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::NonMaxSuppression::Attrs](../../../struct/tensorflow/ops/non-max-suppression/attrs) | Optional attribute setters for [NonMaxSuppression](non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression). |
Public attributes
-----------------
### operation
```
Operation operation
```
### selected\_indices
```
::tensorflow::Output selected_indices
```
Public functions
----------------
### NonMaxSuppression
```
NonMaxSuppression(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size
)
```
### NonMaxSuppression
```
NonMaxSuppression(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
const NonMaxSuppression::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### IouThreshold
```
Attrs IouThreshold(
float x
)
```
tensorflow_cpp tensorflow::ops::Softsign tensorflow::ops::Softsign
=========================
`#include <nn_ops.h>`
Computes softsign: `features / (abs(features) + 1)`.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The activations tensor.
| Constructors and Destructors |
| --- |
| `[Softsign](#classtensorflow_1_1ops_1_1_softsign_1a8cd42df1e016ee15f757268a790cb699)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_softsign_1ac694e94fb8297c3a8682dada2f3527ac)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_softsign_1a783e07b3a724d8c3b03635ca09254143)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_softsign_1a8efd101731877855890460ad2719f485)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_softsign_1a70501ed6e40e30daf3f0b27f44acb41c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_softsign_1af5c9567567cce1d3c69f44418b9ca4cf)() const` | |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### operation
```
Operation operation
```
Public functions
----------------
### Softsign
```
Softsign(
const ::tensorflow::Scope & scope,
::tensorflow::Input features
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MaxPool tensorflow::ops::MaxPool
========================
`#include <nn_ops.h>`
Performs max pooling on the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D input to pool over.
* ksize: The size of the window for each dimension of the input tensor.
* strides: The stride of the sliding window for each dimension of the input tensor.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The max pooled output tensor.
| Constructors and Destructors |
| --- |
| `[MaxPool](#classtensorflow_1_1ops_1_1_max_pool_1a85c264b2e8ed1e7031e9e4692ea8af7c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPool](#classtensorflow_1_1ops_1_1_max_pool_1acb5b1aa4ace59a30fba3bc4181dbc4ff)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPool::Attrs](../../../struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool_1aa2739bb33bb12350d02960466baf596e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool_1aad19527c00a49d78119e18772098c1b3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool_1af4523c29c71806e2dbd3c1137bc875b9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool_1a9a8f1258cb38b51df4ba77452dd41eff)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool_1a6ff803d407d19f2e5c2048399a781ee6)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool_1a0849cb3a4a5b5191cae18dc8825701ef)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_max_pool_1a030dad5a5f8e36ffad1a8d33db104137)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool/attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPool::Attrs](../../../struct/tensorflow/ops/max-pool/attrs) | Optional attribute setters for [MaxPool](max-pool#classtensorflow_1_1ops_1_1_max_pool). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPool
```
MaxPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPool
```
MaxPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPool::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::WholeFileReader tensorflow::ops::WholeFileReader
================================
`#include <io_ops.h>`
A Reader that outputs the entire contents of a file as a value.
Summary
-------
To use, enqueue filenames in a Queue. The output of [ReaderRead](reader-read#classtensorflow_1_1ops_1_1_reader_read) will be a filename (key) and the contents of that file (value).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/whole-file-reader/attrs#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs)`):
* container: If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to reference the Reader.
| Constructors and Destructors |
| --- |
| `[WholeFileReader](#classtensorflow_1_1ops_1_1_whole_file_reader_1aa1c35e8f2f8352797b9635b77952f9f9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| `[WholeFileReader](#classtensorflow_1_1ops_1_1_whole_file_reader_1a4ef11c8797d61f84a2006db95b3735d3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const [WholeFileReader::Attrs](../../../struct/tensorflow/ops/whole-file-reader/attrs#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_whole_file_reader_1a37159601213425dd37c195f248d27ec1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reader\_handle](#classtensorflow_1_1ops_1_1_whole_file_reader_1aeecefa6b0f7149b7b3d9af80215b13ae)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_whole_file_reader_1abd539b43fd56442e781fb8ae6af63bcf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_whole_file_reader_1a176481a380ea4825ffe11d39c0c6d8bb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_whole_file_reader_1a702306e6cf489bc32853e0a0c6e55213)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_whole_file_reader_1a5553b44d78c95d99cf2af758cd8d6c38)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/whole-file-reader/attrs#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_whole_file_reader_1a2d7be816e6afd9942179871198154699)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/whole-file-reader/attrs#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::WholeFileReader::Attrs](../../../struct/tensorflow/ops/whole-file-reader/attrs) | Optional attribute setters for [WholeFileReader](whole-file-reader#classtensorflow_1_1ops_1_1_whole_file_reader). |
Public attributes
-----------------
### operation
```
Operation operation
```
### reader\_handle
```
::tensorflow::Output reader_handle
```
Public functions
----------------
### WholeFileReader
```
WholeFileReader(
const ::tensorflow::Scope & scope
)
```
### WholeFileReader
```
WholeFileReader(
const ::tensorflow::Scope & scope,
const WholeFileReader::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyGradientDescent tensorflow::ops::ResourceApplyGradientDescent
=============================================
`#include <training_ops.h>`
Update '\*var' by subtracting 'alpha' \* 'delta' from it.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* alpha: Scaling factor. Must be a scalar.
* delta: The change.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1_1_attrs)`):
* use\_locking: If `True`, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyGradientDescent](#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1ad2c03e2384a20f89b22a617a6bef1266)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta)` |
| `[ResourceApplyGradientDescent](#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1adaccd5611930bc42bc3813780e45ec68)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta, const [ResourceApplyGradientDescent::Attrs](../../../struct/tensorflow/ops/resource-apply-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1a0ed7094e3b62584bc00bd0a2de76737c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1a063bfdd6045330eed2802d02a8a00c8e)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1a48f17ade21c3f87c38fbfa29434ba55c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyGradientDescent::Attrs](../../../struct/tensorflow/ops/resource-apply-gradient-descent/attrs) | Optional attribute setters for [ResourceApplyGradientDescent](resource-apply-gradient-descent#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyGradientDescent
```
ResourceApplyGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input delta
)
```
### ResourceApplyGradientDescent
```
ResourceApplyGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input delta,
const ResourceApplyGradientDescent::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::AccumulatorSetGlobalStep tensorflow::ops::AccumulatorSetGlobalStep
=========================================
`#include <data_flow_ops.h>`
Updates the accumulator with a new value for global\_step.
Summary
-------
Logs warning if the accumulator's value is already higher than new\_global\_step.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to an accumulator.
* new\_global\_step: The new global\_step value to set.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[AccumulatorSetGlobalStep](#classtensorflow_1_1ops_1_1_accumulator_set_global_step_1a61fec3b7a6eb1fbf46a8a61b9ca39315)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) new_global_step)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_accumulator_set_global_step_1aedb264125674e165047a38a22fc1feeb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_accumulator_set_global_step_1a812f975f5a01b263dd0a3b8d3a4f4429)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### AccumulatorSetGlobalStep
```
AccumulatorSetGlobalStep(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input new_global_step
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::SparseTensorDenseMatMul tensorflow::ops::SparseTensorDenseMatMul
========================================
`#include <sparse_ops.h>`
[Multiply](multiply#classtensorflow_1_1ops_1_1_multiply) SparseTensor (of rank 2) "A" by dense matrix "B".
Summary
-------
No validity checking is performed on the indices of A. However, the following input format is recommended for optimal behavior:
if adjoint\_a == false: A should be sorted in lexicographically increasing order. Use [SparseReorder](sparse-reorder#classtensorflow_1_1ops_1_1_sparse_reorder) if you're not sure. if adjoint\_a == true: A should be sorted in order of increasing dimension 1 (i.e., "column major" order instead of "row major" order).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* a\_indices: 2-D. The `indices` of the `SparseTensor`, size `[nnz, 2]` Matrix.
* a\_values: 1-D. The `values` of the `SparseTensor`, size `[nnz]` Vector.
* a\_shape: 1-D. The `shape` of the `SparseTensor`, size `[2]` Vector.
* b: 2-D. A dense Matrix.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-tensor-dense-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs)`):
* adjoint\_a: Use the adjoint of A in the matrix multiply. If A is complex, this is transpose(conj(A)). Otherwise it's transpose(A).
* adjoint\_b: Use the adjoint of B in the matrix multiply. If B is complex, this is transpose(conj(B)). Otherwise it's transpose(B).
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The product tensor.
| Constructors and Destructors |
| --- |
| `[SparseTensorDenseMatMul](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1adf1f689b8b8d0d72c059efbea5fb9cac)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b)` |
| `[SparseTensorDenseMatMul](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1a3643c83b6940a54319e70b0bc094f948)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b, const [SparseTensorDenseMatMul::Attrs](../../../struct/tensorflow/ops/sparse-tensor-dense-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1a5213c7ac11f10109585773e8fe2cd041)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[product](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1a8895f99af9af5585d8bd937b817bb0ae)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1a3c65317b9c1886136c7de4e03ec51641)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1ac394c138be85d3c36ae20b40f867d72c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1a888b8f4b59aea6d4ff0bdeeba2ad5338)() const` | |
| Public static functions |
| --- |
| `[AdjointA](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1a972ac5b3a5538d477e96e8d1d857ccca)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-tensor-dense-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs)` |
| `[AdjointB](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1ac3e772adcb84c991bdd702ba2f6f7b98)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-tensor-dense-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseTensorDenseMatMul::Attrs](../../../struct/tensorflow/ops/sparse-tensor-dense-mat-mul/attrs) | Optional attribute setters for [SparseTensorDenseMatMul](sparse-tensor-dense-mat-mul#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul). |
Public attributes
-----------------
### operation
```
Operation operation
```
### product
```
::tensorflow::Output product
```
Public functions
----------------
### SparseTensorDenseMatMul
```
SparseTensorDenseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a_indices,
::tensorflow::Input a_values,
::tensorflow::Input a_shape,
::tensorflow::Input b
)
```
### SparseTensorDenseMatMul
```
SparseTensorDenseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a_indices,
::tensorflow::Input a_values,
::tensorflow::Input a_shape,
::tensorflow::Input b,
const SparseTensorDenseMatMul::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AdjointA
```
Attrs AdjointA(
bool x
)
```
### AdjointB
```
Attrs AdjointB(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyAdagradDA tensorflow::ops::ResourceApplyAdagradDA
=======================================
`#include <training_ops.h>`
Update '\*var' according to the proximal adagrad scheme.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* gradient\_accumulator: Should be from a Variable().
* gradient\_squared\_accumulator: Should be from a Variable().
* grad: The gradient.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* global\_step: Training step number. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyAdagradDA](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1ab3cf31032694d9f3fd0a3958f78ec0f5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step)` |
| `[ResourceApplyAdagradDA](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1a474417dc322ba655ca92cc78dc5e04a9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step, const [ResourceApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1ae2393d65d399da864154e800ea95651b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1a20c9b9c6ea4fe8279b0db67b71e767f7)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1ab3c666fb3af46dfde253bbd003df25b9)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad-d-a/attrs) | Optional attribute setters for [ResourceApplyAdagradDA](resource-apply-adagrad-d-a#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyAdagradDA
```
ResourceApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step
)
```
### ResourceApplyAdagradDA
```
ResourceApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step,
const ResourceApplyAdagradDA::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Timestamp tensorflow::ops::Timestamp
==========================
`#include <logging_ops.h>`
Provides the time since epoch in seconds.
Summary
-------
Returns the timestamp as a `float64` for seconds since the Unix epoch.
Note: the timestamp is computed when the op is executed, not when it is added to the graph.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The ts tensor.
| Constructors and Destructors |
| --- |
| `[Timestamp](#classtensorflow_1_1ops_1_1_timestamp_1aba8277601291856dafe7cad9fad13a2f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_timestamp_1a6071f450202ae6e8cfbf967ddf110f76)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[ts](#classtensorflow_1_1ops_1_1_timestamp_1a30de7ae171fb23b7904ce60fbc7f2145)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_timestamp_1a5de4c1a7ddbe87819e2a4b503a840b9c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_timestamp_1a1ed02ff13ff20a545e6402f148dec96f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_timestamp_1ab179eb5df62139a0d58c39e88718dcb2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### ts
```
::tensorflow::Output ts
```
Public functions
----------------
### Timestamp
```
Timestamp(
const ::tensorflow::Scope & scope
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::DrawBoundingBoxes tensorflow::ops::DrawBoundingBoxes
==================================
`#include <image_ops.h>`
Draw bounding boxes on a batch of images.
Summary
-------
Outputs a copy of `images` but draws on top of the pixels zero or more bounding boxes specified by the locations in `boxes`. The coordinates of the each bounding box in `boxes` are encoded as `[y_min, x_min, y_max, x_max]`. The bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and height of the underlying image.
For example, if an image is 100 x 200 pixels (height x width) and the bounding box is `[0.1, 0.2, 0.5, 0.9]`, the upper-left and bottom-right coordinates of the bounding box will be `(40, 10)` to `(180, 50)` (in (x,y) coordinates).
Parts of the bounding box may fall outside the image.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 4-D with shape `[batch, height, width, depth]`. A batch of images.
* boxes: 3-D with shape `[batch, num_bounding_boxes, 4]` containing bounding boxes.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with the same shape as `images`. The batch of input images with bounding boxes drawn on the images.
| Constructors and Destructors |
| --- |
| `[DrawBoundingBoxes](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_1a36778a64785d4874761fc8cd75c7963d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_1ade5996b5c08a78404427015175077267)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_1aefea4317485f5bf21a230bb2c5f1360a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_1a5e8d732e824b4d741105479608cc4a4b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_1a79b868abb859e248316d87c58807e6f8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_1a9c857ad52358b4df98f879d531c8d33d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DrawBoundingBoxes
```
DrawBoundingBoxes(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input boxes
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::UnsortedSegmentProd tensorflow::ops::UnsortedSegmentProd
====================================
`#include <math_ops.h>`
Computes the product along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
This operator is similar to `tf.math.unsorted_segment_sum`, Instead of computing the sum over segments, it computes the product of all entries belonging to a segment such that:
\(output\_i = \prod\_{j...} data[j...]\) where the product is over tuples `j...` such that `segment_ids[j...] == i`.
For example:
c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) tf.math.unsorted\_segment\_prod(c, tf.constant([0, 1, 0]), num\_segments=2).numpy() array([[4, 6, 6, 4], [5, 6, 7, 8]], dtype=int32)
If there is no entry for a given segment ID `i`, it outputs 1.
If the given segment ID `i` is negative, then the corresponding value is dropped, and will not be included in the result. Caution: On CPU, values in `segment_ids` are always validated to be less than `num_segments`, and an error is thrown for out-of-bound indices. On GPU, this does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices result in safe but unspecified behavior, which may include ignoring out-of-bound indices or outputting a tensor with a 0 stored in the first dimension of its shape if `num_segments` is 0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A tensor whose shape is a prefix of `data.shape`. The values must be less than `num_segments`.
Caution: The values are always validated to be in range on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for the first `segment_ids.rank` dimensions, which are replaced with a single dimension which has size `num_segments`.
| Constructors and Destructors |
| --- |
| `[UnsortedSegmentProd](#classtensorflow_1_1ops_1_1_unsorted_segment_prod_1a426fa7bf6679eaddb4357ecd2326ddfd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_unsorted_segment_prod_1a9f38a8974be98df327efd596fbfa4322)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_unsorted_segment_prod_1a3c1839365baeffc25fd511bcfdc9a12b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_unsorted_segment_prod_1a517e5b44536243635df5b97add2deb41)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unsorted_segment_prod_1a0a2a984f6cbed916d58e6a8e9901380d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unsorted_segment_prod_1a561073eeb76d871584129b8b1c648d26)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### UnsortedSegmentProd
```
UnsortedSegmentProd(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::TopK tensorflow::ops::TopK
=====================
`#include <nn_ops.h>`
Finds values and indices of the `k` largest elements for the last dimension.
Summary
-------
If the input is a vector (rank-1), finds the `k` largest entries in the vector and outputs their values and indices as vectors. Thus `values[j]` is the `j`-th largest entry in `input`, and its index is `indices[j]`.
For matrices (resp. higher rank input), computes the top `k` entries in each row (resp. vector along the last dimension). Thus,
```
values.shape = indices.shape = input.shape[:-1] + [k]
```
If two elements are equal, the lower-index element appears first.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 1-D or higher with last dimension at least `k`.
* k: 0-D. Number of top elements to look for along the last dimension (along each row for matrices).
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs)`):
* sorted: If true the resulting `k` elements will be sorted by the values in descending order.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` values: The `k` largest elements along each last dimensional slice.
* `[Output](../output#classtensorflow_1_1_output)` indices: The indices of `values` within the last dimension of `input`.
| Constructors and Destructors |
| --- |
| `[TopK](#classtensorflow_1_1ops_1_1_top_k_1a0c8404c5e20cae7d52b460b213d13bf4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k)` |
| `[TopK](#classtensorflow_1_1ops_1_1_top_k_1ad55e14f1c8e36a07ae7e3e5189ce1de6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, const [TopK::Attrs](../../../struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[indices](#classtensorflow_1_1ops_1_1_top_k_1a702b5fcc223806a5b43892c840294e6e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_top_k_1a6772614af084e9178999f8b10e356ce4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_top_k_1a3d754e075cd5e04093e27e60a6a07727)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Sorted](#classtensorflow_1_1ops_1_1_top_k_1ac5e55d49539ee3457dc1a432480e85c2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TopK::Attrs](../../../struct/tensorflow/ops/top-k/attrs) | Optional attribute setters for [TopK](top-k#classtensorflow_1_1ops_1_1_top_k). |
Public attributes
-----------------
### indices
```
::tensorflow::Output indices
```
### operation
```
Operation operation
```
### values
```
::tensorflow::Output values
```
Public functions
----------------
### TopK
```
TopK(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input k
)
```
### TopK
```
TopK(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input k,
const TopK::Attrs & attrs
)
```
Public static functions
-----------------------
### Sorted
```
Attrs Sorted(
bool x
)
```
tensorflow_cpp tensorflow::ops::Round tensorflow::ops::Round
======================
`#include <math_ops.h>`
Rounds the values of a tensor to the nearest integer, element-wise.
Summary
-------
Rounds half to even. Also known as bankers rounding. If you want to round according to the current system rounding mode use std::cint.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Round](#classtensorflow_1_1ops_1_1_round_1a5387851ecd5d1211cf85acf4b9f368fa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_round_1a7d3cb3e7432b5bd22b67a2972fab6a3a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_round_1a6417f345646d1acd8950d36c16ae3f53)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_round_1a6e23b524c7483b24bda1232efd2371c8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_round_1ad3ad38090cabcee79890b56eb17768f1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_round_1a870e0deb2902951da1fcb76176111564)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Round
```
Round(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Cross tensorflow::ops::Cross
======================
`#include <math_ops.h>`
Compute the pairwise cross product.
Summary
-------
`a` and `b` must be the same shape; they can either be simple 3-element vectors, or any shape where the innermost dimension is 3. In the latter case, each pair of corresponding 3-element vectors is cross-multiplied independently.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* a: A tensor containing 3-element vectors.
* b: Another tensor, of same type and shape as `a`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Pairwise cross product of the vectors in `a` and `b`.
| Constructors and Destructors |
| --- |
| `[Cross](#classtensorflow_1_1ops_1_1_cross_1a2d0d3e2d7c97664d9580df02605d9db9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_cross_1a00b77699cc5ca96059de9e00ba6bad3d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[product](#classtensorflow_1_1ops_1_1_cross_1af8a37ae245753365a272a83d54cb471f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_cross_1ac31667b61bd41cbe5ecb0c20852475d9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cross_1abafd2b168be8b2ceb0944b95755281eb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cross_1a2303acdef93919770fab13f504054c34)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### product
```
::tensorflow::Output product
```
Public functions
----------------
### Cross
```
Cross(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApplyFtrlV2 tensorflow::ops::ApplyFtrlV2
============================
`#include <training_ops.h>`
Update '\*var' according to the Ftrl-proximal scheme.
Summary
-------
grad\_with\_shrinkage = grad + 2 \* l2\_shrinkage \* var accum\_new = accum + grad \* grad linear += grad\_with\_shrinkage - (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 shrinkage regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyFtrlV2](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1add964fb0f6de2aa24265dcd061c72151)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[ApplyFtrlV2](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1a0b32d8c13b43426f739ff6590cd07303)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [ApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1aff11a6d3c5a685a3bce58b6eba270910)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1a37c9c6929132980b64306940e4296ed2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1ab2dafdb4818ad20aa0e4eed79cfba879)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1a1aede95dcc376ee0ac6c62cfe06d7314)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1a331dd3212dc856b76c62ccc135c74656)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1aad4be57c71c744c8f188d58e39c7c910)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_ftrl_v2_1a5c25a36e1a6eef1e216f631e173e3e42)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/apply-ftrl-v2/attrs) | Optional attribute setters for [ApplyFtrlV2](apply-ftrl-v2#classtensorflow_1_1ops_1_1_apply_ftrl_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyFtrlV2
```
ApplyFtrlV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input l2_shrinkage,
::tensorflow::Input lr_power
)
```
### ApplyFtrlV2
```
ApplyFtrlV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input l2_shrinkage,
::tensorflow::Input lr_power,
const ApplyFtrlV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseSegmentSqrtNWithNumSegments tensorflow::ops::SparseSegmentSqrtNWithNumSegments
==================================================
`#include <math_ops.h>`
Computes the sum along sparse segments of a tensor divided by the sqrt of N.
Summary
-------
N is the size of the segment being reduced.
Like `[SparseSegmentSqrtN](sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n)`, but allows missing ids in `segment_ids`. If an id is missing, the `output` tensor at that position will be zeroed.
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: A 1-D tensor. Has same rank as `segment_ids`.
* segment\_ids: A 1-D tensor. Values should be sorted and can be repeated.
* num\_segments: Should equal the number of distinct segment IDs.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SparseSegmentSqrtNWithNumSegments](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_with_num_segments_1a44628573cc0d7a5d5f1e052fca589e99)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_with_num_segments_1a52c0c9df8a62e1641e0046f28df5c10d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_with_num_segments_1a867a58de56787260c7fd1d9d19d4b1d5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_with_num_segments_1acb321311f506a64be7d944bb1473a74d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_with_num_segments_1ab82167559d0a3e1be21f18c31272e6a8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_with_num_segments_1a29951f747e60f40b1657638181d5ab40)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentSqrtNWithNumSegments
```
SparseSegmentSqrtNWithNumSegments(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input indices,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Cos tensorflow::ops::Cos
====================
`#include <math_ops.h>`
Computes cos of x element-wise.
Summary
-------
Given an input tensor, this function computes cosine of every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `(-inf, inf)` and output range is `[-1,1]`. If input lies outside the boundary, `nan` is returned.
```
x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.cos(x) ==> [nan -0.91113025 0.87758255 0.5403023 0.36235774 0.48718765 -0.95215535 nan]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Cos](#classtensorflow_1_1ops_1_1_cos_1a4ce1eaf028ad3e711a91dcd15b0c507f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_cos_1a4ffd18df457c2a2c8275cf2425e489e9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_cos_1af2e653ddc7ca687b13e27ec5529f316a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_cos_1a134873100b8bd65d802cfbfad2ad260c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cos_1a198fd4284911414e52ceb9b8f884ea58)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cos_1a2a0d44fe189b87af6d3f178798ee084a)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Cos
```
Cos(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::TFRecordReader tensorflow::ops::TFRecordReader
===============================
`#include <io_ops.h>`
A Reader that outputs the records from a TensorFlow Records file.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/t-f-record-reader/attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)`):
* container: If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to reference the Reader.
| Constructors and Destructors |
| --- |
| `[TFRecordReader](#classtensorflow_1_1ops_1_1_t_f_record_reader_1a467c87e79aa01d61d9a1d54435c158c4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| `[TFRecordReader](#classtensorflow_1_1ops_1_1_t_f_record_reader_1aa074860815a8b0bdae5815823813753e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const [TFRecordReader::Attrs](../../../struct/tensorflow/ops/t-f-record-reader/attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_t_f_record_reader_1ac3500d9636020797440200c51e50791e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reader\_handle](#classtensorflow_1_1ops_1_1_t_f_record_reader_1a64c1049ec100579e3da0d5d7a57d0432)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_t_f_record_reader_1aaece718d36a1af5ae68cca57451babeb)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_t_f_record_reader_1aa5a6a0df05d31cd2d219a006e7807562)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_t_f_record_reader_1a1efc6472173ce07316b4989da86279fd)() const` | |
| Public static functions |
| --- |
| `[CompressionType](#classtensorflow_1_1ops_1_1_t_f_record_reader_1a3012010b01197e7b86d237224213ce60)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/t-f-record-reader/attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_t_f_record_reader_1af8fdecbacfe0176cb27a1fb0e2c7987a)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/t-f-record-reader/attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_t_f_record_reader_1ad3a64752837ffd524d68373f2250ebd9)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/t-f-record-reader/attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TFRecordReader::Attrs](../../../struct/tensorflow/ops/t-f-record-reader/attrs) | Optional attribute setters for [TFRecordReader](t-f-record-reader#classtensorflow_1_1ops_1_1_t_f_record_reader). |
Public attributes
-----------------
### operation
```
Operation operation
```
### reader\_handle
```
::tensorflow::Output reader_handle
```
Public functions
----------------
### TFRecordReader
```
TFRecordReader(
const ::tensorflow::Scope & scope
)
```
### TFRecordReader
```
TFRecordReader(
const ::tensorflow::Scope & scope,
const TFRecordReader::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### CompressionType
```
Attrs CompressionType(
StringPiece x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ScatterNdSub tensorflow::ops::ScatterNdSub
=============================
`#include <state_ops.h>`
Applies sparse subtraction to individual values or slices in a [Variable](variable#classtensorflow_1_1ops_1_1_variable).
Summary
-------
within a given variable according to `indices`.
`ref` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with rank `P` and `indices` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of `indices` (with length `K`) corresponds to indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th dimension of `ref`.
`updates` is `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q-1+P-K` with shape:
```
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
```
For example, say we want to subtract 4 scattered elements from a rank-1 tensor with 8 elements. In Python, that subtraction would look like this:
```
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
sub = tf.scatter_nd_sub(ref, indices, updates)
with tf.Session() as sess:
print sess.run(sub)
```
The resulting update to ref would look like this:
```
[1, -9, 3, -6, -4, 6, 7, -4]
```
See `tf.scatter_nd` for more details about how to make updates to slices.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A mutable [Tensor](../tensor#classtensorflow_1_1_tensor). Should be from a [Variable](variable#classtensorflow_1_1ops_1_1_variable) node.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of updated values to subtract from ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-nd-sub/attrs#structtensorflow_1_1ops_1_1_scatter_nd_sub_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as ref. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterNdSub](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1ae406028cdb445b008dc38cb063867d92)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterNdSub](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1a6095e143f12d98bdd6840e3c82b0849e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterNdSub::Attrs](../../../struct/tensorflow/ops/scatter-nd-sub/attrs#structtensorflow_1_1ops_1_1_scatter_nd_sub_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1a3ce12481ccf50ae215315bae8f9ebaa6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1a2b35fc093c9c33c9fb2117ce2d348f1e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1a395194967a9288f615ec9e74e220043a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1ad87ae02563483cc2d919170789fbf278)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1ae3ae0bc213eec019e7ab8a5fe78171df)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_nd_sub_1a0378357edf53a55d9d8bcd4f18730266)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-nd-sub/attrs#structtensorflow_1_1ops_1_1_scatter_nd_sub_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterNdSub::Attrs](../../../struct/tensorflow/ops/scatter-nd-sub/attrs) | Optional attribute setters for [ScatterNdSub](scatter-nd-sub#classtensorflow_1_1ops_1_1_scatter_nd_sub). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterNdSub
```
ScatterNdSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterNdSub
```
ScatterNdSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterNdSub::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Conv3D tensorflow::ops::Conv3D
=======================
`#include <nn_ops.h>`
Computes a 3-D convolution given 5-D `input` and `filter` tensors.
Summary
-------
In signal processing, cross-correlation is a measure of similarity of two waveforms as a function of a time-lag applied to one of them. This is also known as a sliding dot product or sliding inner-product.
Our [Conv3D](conv3-d#classtensorflow_1_1ops_1_1_conv3_d) implements a form of cross-correlation.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Shape `[batch, in_depth, in_height, in_width, in_channels]`.
* filter: Shape `[filter_depth, filter_height, filter_width, in_channels, out_channels]`. `in_channels` must match between `input` and `filter`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conv3-d/attrs#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
* dilations: 1-D tensor of length 5. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Conv3D](#classtensorflow_1_1ops_1_1_conv3_d_1aef63039997c4f9586d2b8627e3cf5c5a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[Conv3D](#classtensorflow_1_1ops_1_1_conv3_d_1abb396c1cb8bf48f57ad11862ac7406ad)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const [Conv3D::Attrs](../../../struct/tensorflow/ops/conv3-d/attrs#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conv3_d_1a34a87b1c84b82ab0a1dec637ee277ced)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conv3_d_1a426b9a63272f1905184fdfd1b78ba33a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conv3_d_1a33ab1a0f2fa69089a8f835175d1dc732)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conv3_d_1a418b91ef5b6437901248965d572533e5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conv3_d_1abebfb46d5b9c472aebb4f25ad6d2eeb6)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_conv3_d_1a148ca9c798353ee9073c60f57e45a41f)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conv3-d/attrs#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_conv3_d_1a90d138624ebc69f365e225d25ece6e2a)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv3-d/attrs#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Conv3D::Attrs](../../../struct/tensorflow/ops/conv3-d/attrs) | Optional attribute setters for [Conv3D](conv3-d#classtensorflow_1_1ops_1_1_conv3_d). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conv3D
```
Conv3D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### Conv3D
```
Conv3D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const Conv3D::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::HistogramFixedWidth tensorflow::ops::HistogramFixedWidth
====================================
`#include <math_ops.h>`
Return histogram of values.
Summary
-------
Given the tensor `values`, this operation returns a rank 1 histogram counting the number of entries in `values` that fall into every bin. The bins are equal width and determined by the arguments `value_range` and `nbins`.
```
# Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
nbins = 5
value_range = [0.0, 5.0]
new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
```
```
with tf.get_default_session() as sess:
hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
variables.global_variables_initializer().run()
sess.run(hist) => [2, 1, 1, 0, 2]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* values: Numeric `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* value\_range: Shape [2] `[Tensor](../tensor#classtensorflow_1_1_tensor)` of same `dtype` as `values`. values <= value\_range[0] will be mapped to hist[0], values >= value\_range[1] will be mapped to hist[-1].
* nbins: Scalar `int32 [Tensor](../tensor#classtensorflow_1_1_tensor)`. Number of histogram bins.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 1-D `[Tensor](../tensor#classtensorflow_1_1_tensor)` holding histogram of values.
| Constructors and Destructors |
| --- |
| `[HistogramFixedWidth](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a333002784eada5d11649a32ff58a5bce)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value_range, ::[tensorflow::Input](../input#classtensorflow_1_1_input) nbins)` |
| `[HistogramFixedWidth](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a1284e095c6b69e072988d8beecea179f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value_range, ::[tensorflow::Input](../input#classtensorflow_1_1_input) nbins, const [HistogramFixedWidth::Attrs](../../../struct/tensorflow/ops/histogram-fixed-width/attrs#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a34fee699d7f4fdb4577eb33f6f46c23c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a587b8e7c9541b52daed045e791a0520d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1afa5f92867dd3834b3808d6d25177c002)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a699360f21e94439323f32adaa8b09e30)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a4136d809be17e0bbd261e44d9dd9b377)() const` | |
| Public static functions |
| --- |
| `[Dtype](#classtensorflow_1_1ops_1_1_histogram_fixed_width_1a9856da0e7bf5f4751e54495801a9f8e2)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/histogram-fixed-width/attrs#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::HistogramFixedWidth::Attrs](../../../struct/tensorflow/ops/histogram-fixed-width/attrs) | Optional attribute setters for [HistogramFixedWidth](histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### HistogramFixedWidth
```
HistogramFixedWidth(
const ::tensorflow::Scope & scope,
::tensorflow::Input values,
::tensorflow::Input value_range,
::tensorflow::Input nbins
)
```
### HistogramFixedWidth
```
HistogramFixedWidth(
const ::tensorflow::Scope & scope,
::tensorflow::Input values,
::tensorflow::Input value_range,
::tensorflow::Input nbins,
const HistogramFixedWidth::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Dtype
```
Attrs Dtype(
DataType x
)
```
tensorflow_cpp tensorflow::ops::DepthwiseConv2dNativeBackpropInput tensorflow::ops::DepthwiseConv2dNativeBackpropInput
===================================================
`#include <nn_ops.h>`
Computes the gradients of depthwise convolution with respect to the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_sizes: An integer vector representing the shape of `input`, based on `data_format`. For example, if `data_format` is 'NHWC' then `input` is a 4-D `[batch, height, width, channels]` tensor.
* filter: 4-D with shape `[filter_height, filter_width, in_channels, depthwise_multiplier]`.
* out\_backprop: 4-D with shape based on `data_format`. For example, if `data_format` is 'NHWC' then out\_backprop shape is `[batch, out_height, out_width, out_channels]`. Gradients w.r.t. the output of the convolution.
* strides: The stride of the sliding window for each dimension of the input of the convolution.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-input/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width].
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape according to `data_format`. For example, if `data_format` is 'NHWC', output shape is `[batch, in_height, in_width, in_channels]`. Gradient w.r.t. the input of the convolution.
| Constructors and Destructors |
| --- |
| `[DepthwiseConv2dNativeBackpropInput](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a44860b426baf7a003c44728e835f9d05)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[DepthwiseConv2dNativeBackpropInput](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a014c3bb2ee403a82ec24f10992c7b580)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding, const [DepthwiseConv2dNativeBackpropInput::Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-input/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a66a4628fc7014482be2512ecff5a7f06)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a024ccdda3b9ee57913c71eb5dae1929c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a6e062166cae2aa251281f02dcec6154c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a4d40006ebcb3defcaf1f2e6e469516d9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1af4f0b912eeeefe1eecf1c33eb20dd4b4)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a3120c51e47ec70855e85f50c57743e34)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-input/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1a94c81fcd8b2ef27c98cec5ec75a8819b)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-input/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1abc58e411afeb3fc0f3bdae0dafef12bc)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-input/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-input/attrs) | Optional attribute setters for [DepthwiseConv2dNativeBackpropInput](depthwise-conv2d-native-backprop-input#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DepthwiseConv2dNativeBackpropInput
```
DepthwiseConv2dNativeBackpropInput(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_sizes,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### DepthwiseConv2dNativeBackpropInput
```
DepthwiseConv2dNativeBackpropInput(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_sizes,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const DepthwiseConv2dNativeBackpropInput::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
tensorflow_cpp tensorflow::ops::Reciprocal tensorflow::ops::Reciprocal
===========================
`#include <math_ops.h>`
Computes the reciprocal of x element-wise.
Summary
-------
I.e., \(y = 1 / x\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Reciprocal](#classtensorflow_1_1ops_1_1_reciprocal_1a18cf2af7a4bbe5843ae3fbd7216b2426)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reciprocal_1ae5ace57e2fa6a69848a642db6dedc85d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_reciprocal_1a902cb2571d8dc9ed465eff0ff0350b6e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_reciprocal_1a0a44a532a5df267c0c5552e328ae5244)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_reciprocal_1add7af19109dfcf10a79108f9ca48c88e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_reciprocal_1ad3b0426b85db150bd03e804b63bb9854)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Reciprocal
```
Reciprocal(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AccumulateNV2 tensorflow::ops::AccumulateNV2
==============================
`#include <math_ops.h>`
Returns the element-wise sum of a list of tensors.
Summary
-------
`tf.accumulate_n_v2` performs the same operation as `tf.add_n`, but does not wait for all of its inputs to be ready before beginning to sum. This can save memory if inputs are ready at different times, since minimum temporary storage is proportional to the output size rather than the inputs size.
Unlike the original `accumulate_n`, `accumulate_n_v2` is differentiable.
Returns a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of same shape and type as the elements of `inputs`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* inputs: A list of `[Tensor](../tensor#classtensorflow_1_1_tensor)` objects, each with same shape and type.
* shape: Shape of elements of `inputs`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The sum tensor.
| Constructors and Destructors |
| --- |
| `[AccumulateNV2](#classtensorflow_1_1ops_1_1_accumulate_n_v2_1aa0b3bc0d86d99eb42148d4c9d7423caf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs, PartialTensorShape shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_accumulate_n_v2_1a8b34be58d7304da7f97f715aae7475af)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sum](#classtensorflow_1_1ops_1_1_accumulate_n_v2_1acdb8321212157356c76d4ab16bbf887a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_accumulate_n_v2_1a3488361c0e26fd5b00e136e09ef3dc31)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_accumulate_n_v2_1a320e247fd2d3ca8ad4564e13c9605397)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_accumulate_n_v2_1a877c1f164066934c89ed718f5ffc7352)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### sum
```
::tensorflow::Output sum
```
Public functions
----------------
### AccumulateNV2
```
AccumulateNV2(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs,
PartialTensorShape shape
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MatrixDiag tensorflow::ops::MatrixDiag
===========================
`#include <array_ops.h>`
Returns a batched diagonal tensor with a given batched diagonal values.
Summary
-------
Given a `diagonal`, this operation returns a tensor with the `diagonal` and everything else padded with zeros. The diagonal is computed as follows:
Assume `diagonal` has `k` dimensions `[I, J, K, ..., N]`, then the output is a tensor of rank `k+1` with dimensions [I, J, K, ..., N, N]` where:
`output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]`.
For example:
```
# 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]
```
```
and diagonal.shape = (2, 4)
```
```
tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]],
[[5, 0, 0, 0]
[0, 6, 0, 0]
[0, 0, 7, 0]
[0, 0, 0, 8]]]
```
```
which has shape (2, 4, 4)
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* diagonal: Rank `k`, where `k >= 1`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Rank `k+1`, with `output.shape = diagonal.shape + [diagonal.shape[-1]]`.
| Constructors and Destructors |
| --- |
| `[MatrixDiag](#classtensorflow_1_1ops_1_1_matrix_diag_1a2b263945a55c830cec2aa8e732ad4c37)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_diag_1a2a3f9fd08f8b6b8b5209a62bc2c0e4e4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_matrix_diag_1aba2480ed932f279c48fc6028f6be7a92)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_diag_1aa1db7faefb57b9fee4eddaee99c3a5a3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_diag_1ae38fc37ca0a5a229e9c9d3f827ebfa6d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_diag_1aaaad00f636d2ad7be0fd131133b79006)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MatrixDiag
```
MatrixDiag(
const ::tensorflow::Scope & scope,
::tensorflow::Input diagonal
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::InplaceSub tensorflow::ops::InplaceSub
===========================
`#include <array_ops.h>`
Subtracts `v` into specified rows of `x`.
Summary
-------
Computes y = x; y[i, :] -= v; return y.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T.
* i: A vector. Indices into the left-most dimension of `x`.
* v: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`.
| Constructors and Destructors |
| --- |
| `[InplaceSub](#classtensorflow_1_1ops_1_1_inplace_sub_1a1d671002c01f41fc9515b017cd3d0a2a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) i, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_inplace_sub_1a5fcdd5f9defcd72b7c66580522e39a29)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_inplace_sub_1a629a120f097dd646d8d51588bf5a01d6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_inplace_sub_1a3d74bbe142eec7e547bccefcdde97fe1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_inplace_sub_1a900071a1f4a6987e32cfdd6c60677386)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_inplace_sub_1ab48e6346ac5f9b4b96d91d44c0ad449c)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### InplaceSub
```
InplaceSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input i,
::tensorflow::Input v
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::MapPeek tensorflow::ops::MapPeek
========================
`#include <data_flow_ops.h>`
Op peeks at the values at the specified key.
Summary
-------
If the
underlying container does not contain this key this op will block until it does.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The values tensor.
| Constructors and Destructors |
| --- |
| `[MapPeek](#classtensorflow_1_1ops_1_1_map_peek_1aaba336678cb71ff7a83374e34dfbec95)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes)` |
| `[MapPeek](#classtensorflow_1_1ops_1_1_map_peek_1aa21b3f4cd0a135aa4f4fd922a1de9c5a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes, const [MapPeek::Attrs](../../../struct/tensorflow/ops/map-peek/attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_map_peek_1a21d139e51ea7726007f77e1e02758697)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_map_peek_1a5e19050900926c7f7bf34218e3c77830)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_map_peek_1a6378019d756a6ecff65fe2c3763a41bf)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_peek_1a5a8f5fa44a942e9302829cd80884800f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-peek/attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_peek_1ad5a48c98eefb8785e763732fb086cf95)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-peek/attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_peek_1a74165d2886ad1b0555b198b6002b3b11)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-peek/attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_peek_1ac6399b1d5451c4ada764385d1f1bb4b1)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-peek/attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapPeek::Attrs](../../../struct/tensorflow/ops/map-peek/attrs) | Optional attribute setters for [MapPeek](map-peek#classtensorflow_1_1ops_1_1_map_peek). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### MapPeek
```
MapPeek(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes
)
```
### MapPeek
```
MapPeek(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes,
const MapPeek::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ArgMax tensorflow::ops::ArgMax
=======================
`#include <math_ops.h>`
Returns the index with the largest value across dimensions of a tensor.
Summary
-------
Note that in case of ties the identity of the return value is not guaranteed.
Usage:
```
import tensorflow as tf
a = [1, 10, 26.9, 2.8, 166.32, 62.3]
b = tf.math.argmax(input = a)
c = tf.keras.backend.eval(b)
# c = 4
# here a[4] = 166.32 which is the largest element of a across axis 0
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* dimension: int16, int32 or int64, must be in the range `[-rank(input), rank(input))`. Describes which dimension of the input [Tensor](../tensor#classtensorflow_1_1_tensor) to reduce across. For vectors, use dimension = 0.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[ArgMax](#classtensorflow_1_1ops_1_1_arg_max_1abfe8a95c471e85d0f404f93189a3d616)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dimension)` |
| `[ArgMax](#classtensorflow_1_1ops_1_1_arg_max_1a534c4b1988d0fe5c5150338c42c115b2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dimension, const [ArgMax::Attrs](../../../struct/tensorflow/ops/arg-max/attrs#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_arg_max_1a60663c9ffb26ff3cb9dc201881e87a3a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_arg_max_1a2e1f5ef358c10195be899e08e0a3b46c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_arg_max_1ad8106e00a969b5bb5791dd57f0831f26)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_arg_max_1accba38db65bed3a37b5872a4d19b5dae)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_arg_max_1a1620a09f5066f00dc88f6ed91b70cd37)() const` | |
| Public static functions |
| --- |
| `[OutputType](#classtensorflow_1_1ops_1_1_arg_max_1a25eece835d32a5e813f6bbe1047fc6e8)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/arg-max/attrs#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ArgMax::Attrs](../../../struct/tensorflow/ops/arg-max/attrs) | Optional attribute setters for [ArgMax](arg-max#classtensorflow_1_1ops_1_1_arg_max). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ArgMax
```
ArgMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input dimension
)
```
### ArgMax
```
ArgMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input dimension,
const ArgMax::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### OutputType
```
Attrs OutputType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::SegmentMax tensorflow::ops::SegmentMax
===========================
`#include <math_ops.h>`
Computes the maximum along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Computes a tensor such that \(output\_i = \max\_j(data\_j)\) where `max` is over `j` such that `segment_ids[j] == i`.
If the max is empty for a given segment ID `i`, `output[i] = 0`.
Caution: On CPU, values in `segment_ids` are always validated to be sorted, and an error is thrown for indices that are not increasing. On GPU, this does not throw an error for unsorted indices. On GPU, out-of-order indices result in safe but unspecified behavior, which may include treating out-of-order indices as the same as a smaller following index.

For example:
c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.math.segment\_max(c, tf.constant([0, 0, 1])).numpy() array([[4, 3, 3, 4], [5, 6, 7, 8]], dtype=int32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A 1-D tensor whose size is equal to the size of `data`'s first dimension. Values should be sorted and can be repeated.
Caution: The values are always validated to be sorted on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SegmentMax](#classtensorflow_1_1ops_1_1_segment_max_1ae4c7c390ebf289ff8b4de9e26c04944d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_segment_max_1a9d7aa3e5cc9283250afb83d66ee4c81b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_segment_max_1abb826dec7ad700d6b93e71af9568eed4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_segment_max_1afe37a0f014062db41fe346c5594ae8d2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_segment_max_1adae8d27ab33077b55ab6c154df771efc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_segment_max_1a6a4bf875628911d28f75aab9cec0230f)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SegmentMax
```
SegmentMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SampleDistortedBoundingBoxV2 tensorflow::ops::SampleDistortedBoundingBoxV2
=============================================
`#include <image_ops.h>`
Generate a single randomly distorted bounding box for an image.
Summary
-------
Bounding box annotations are often supplied in addition to ground-truth labels in image recognition or object localization tasks. A common technique for training such a system is to randomly distort an image while preserving its content, i.e. *data augmentation*. This Op outputs a randomly distorted localization of an object, i.e. bounding box, given an `image_size`, `bounding_boxes` and a series of constraints.
The output of this Op is a single bounding box that may be used to crop the original image. The output is returned as 3 tensors: `begin`, `size` and `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize what the bounding box looks like.
Bounding boxes are supplied and returned as `[y_min, x_min, y_max, x_max]`. The bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and height of the underlying image.
For example,
```
# Generate a single distorted bounding box.
begin, size, bbox_for_draw = tf.image.sample_distorted_bounding_box(
tf.shape(image),
bounding_boxes=bounding_boxes)
```
```
# Draw the bounding box in an image summary.
image_with_box = tf.image.draw_bounding_boxes(tf.expand_dims(image, 0),
bbox_for_draw)
tf.summary.image('images_with_box', image_with_box)
```
```
# Employ the bounding box to distort the image.
distorted_image = tf.slice(image, begin, size)
```
Note that if no bounding box information is available, setting `use_image_if_no_bounding_boxes = true` will assume there is a single implicit bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is false and no bounding boxes are supplied, an error is raised.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* image\_size: 1-D, containing `[height, width, channels]`.
* bounding\_boxes: 3-D with shape `[batch, N, 4]` describing the N bounding boxes associated with the image.
* min\_object\_covered: The cropped area of the image must contain at least this fraction of any bounding box supplied. The value of this parameter should be non-negative. In the case of 0, the cropped area does not need to overlap any of the bounding boxes supplied.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
* aspect\_ratio\_range: The cropped area of the image must have an aspect ratio = width / height within this range.
* area\_range: The cropped area of the image must contain a fraction of the supplied image within this range.
* max\_attempts: Number of attempts at generating a cropped region of the image of the specified constraints. After `max_attempts` failures, return the entire image.
* use\_image\_if\_no\_bounding\_boxes: Controls behavior if no bounding boxes supplied. If true, assume an implicit bounding box covering the whole input. If false, raise an error.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` begin: 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to `tf.slice`.
* `[Output](../output#classtensorflow_1_1_output)` size: 1-D, containing `[target_height, target_width, -1]`. Provide as input to `tf.slice`.
* `[Output](../output#classtensorflow_1_1_output)` bboxes: 3-D with shape `[1, 1, 4]` containing the distorted bounding box. Provide as input to `tf.image.draw_bounding_boxes`.
| Constructors and Destructors |
| --- |
| `[SampleDistortedBoundingBoxV2](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1a633c7a8fbd11d968753f7db7f8cb7c77)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bounding_boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_object_covered)` |
| `[SampleDistortedBoundingBoxV2](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1a1ef02f96804b5d3af88d2d7cae711680)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bounding_boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_object_covered, const [SampleDistortedBoundingBoxV2::Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[bboxes](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1a5d0358f3cdc7973434e015fa6f3fe62b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[begin](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1af9d2d6c57b4b1e64bc1ab2995e11a8ef)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1ac4143ebffc12cab6d5b82b75e33eb651)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1a5fd41322042a9c0f149f4ac711dd3447)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[AreaRange](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1abba18b38ff171324e05dac58493e7b90)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` |
| `[AspectRatioRange](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1aa01c6c23d7fc5888fc28358d4408fe10)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` |
| `[MaxAttempts](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1adfa00342bdb57c3ba355f97d1b57f525)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1a019982d4504da89850b6e7ca7aa91ad3)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1ad49de5c7f25d7017493f33cc34503692)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` |
| `[UseImageIfNoBoundingBoxes](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1a9e8e8674c6cfb73384697ffb8da60062)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box-v2/attrs) | Optional attribute setters for [SampleDistortedBoundingBoxV2](sample-distorted-bounding-box-v2#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2). |
Public attributes
-----------------
### bboxes
```
::tensorflow::Output bboxes
```
### begin
```
::tensorflow::Output begin
```
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### SampleDistortedBoundingBoxV2
```
SampleDistortedBoundingBoxV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input image_size,
::tensorflow::Input bounding_boxes,
::tensorflow::Input min_object_covered
)
```
### SampleDistortedBoundingBoxV2
```
SampleDistortedBoundingBoxV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input image_size,
::tensorflow::Input bounding_boxes,
::tensorflow::Input min_object_covered,
const SampleDistortedBoundingBoxV2::Attrs & attrs
)
```
Public static functions
-----------------------
### AreaRange
```
Attrs AreaRange(
const gtl::ArraySlice< float > & x
)
```
### AspectRatioRange
```
Attrs AspectRatioRange(
const gtl::ArraySlice< float > & x
)
```
### MaxAttempts
```
Attrs MaxAttempts(
int64 x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
### UseImageIfNoBoundingBoxes
```
Attrs UseImageIfNoBoundingBoxes(
bool x
)
```
tensorflow_cpp tensorflow::ops::FusedBatchNormGrad tensorflow::ops::FusedBatchNormGrad
===================================
`#include <nn_ops.h>`
Gradient for batch normalization.
Summary
-------
Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* y\_backprop: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to y.
* x: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for input data.
* scale: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.
* reserve\_space\_1: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean to be reused in gradient computation. When is\_training is False, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the population mean to be reused in both 1st and 2nd order gradient computation.
* reserve\_space\_2: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case) to be reused in gradient computation. When is\_training is False, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the population variance to be reused in both 1st and 2nd order gradient computation.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)`):
* epsilon: A small float number added to the variance of x.
* data\_format: The data format for y\_backprop, x, x\_backprop. Either "NHWC" (default) or "NCHW".
* is\_training: A bool value to indicate the operation is for training (default) or inference.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` x\_backprop: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to x.
* `[Output](../output#classtensorflow_1_1_output)` scale\_backprop: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to scale.
* `[Output](../output#classtensorflow_1_1_output)` offset\_backprop: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to offset.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_3: Unused placeholder to match the mean input in [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm).
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_4: Unused placeholder to match the variance input in [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm).
| Constructors and Destructors |
| --- |
| `[FusedBatchNormGrad](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a29e7af89304668b72f3a9741d9135446)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y_backprop, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_2)` |
| `[FusedBatchNormGrad](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1ad28cd25e098ff0c4950e5442700525bd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y_backprop, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_2, const [FusedBatchNormGrad::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[offset\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1af810889b9fc9d4834fa2ebae7f82cd9d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a3bab3f206d975bbe4f6ee0dee56067dd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reserve\_space\_3](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a33ba927a145b4dfcd0a4b8b35184b86c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_4](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a09b361117c6b374e8a07c97bdbbdbcee)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[scale\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a4eaeefc4f041fba23d1746e7ed7b54ff)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[x\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a916a436e2db5bd8db1227d2a3c979c8e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a0bd2ab8db87dc5f730bd45daefcdbcaf)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)` |
| `[Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1ac58037cdbac7b7a90522cf6bd4c524ee)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)` |
| `[IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_1a94d0078f0786e17f4d9f9c188f86ca1a)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedBatchNormGrad::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad/attrs) | Optional attribute setters for [FusedBatchNormGrad](fused-batch-norm-grad#classtensorflow_1_1ops_1_1_fused_batch_norm_grad). |
Public attributes
-----------------
### offset\_backprop
```
::tensorflow::Output offset_backprop
```
### operation
```
Operation operation
```
### reserve\_space\_3
```
::tensorflow::Output reserve_space_3
```
### reserve\_space\_4
```
::tensorflow::Output reserve_space_4
```
### scale\_backprop
```
::tensorflow::Output scale_backprop
```
### x\_backprop
```
::tensorflow::Output x_backprop
```
Public functions
----------------
### FusedBatchNormGrad
```
FusedBatchNormGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input y_backprop,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input reserve_space_1,
::tensorflow::Input reserve_space_2
)
```
### FusedBatchNormGrad
```
FusedBatchNormGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input y_backprop,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input reserve_space_1,
::tensorflow::Input reserve_space_2,
const FusedBatchNormGrad::Attrs & attrs
)
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Epsilon
```
Attrs Epsilon(
float x
)
```
### IsTraining
```
Attrs IsTraining(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::NonMaxSuppressionV3 tensorflow::ops::NonMaxSuppressionV3
====================================
`#include <image_ops.h>`
Greedily selects a subset of bounding boxes in descending order of score,.
Summary
-------
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected\_indices = tf.image.non\_max\_suppression\_v2( boxes, scores, max\_output\_size, iou\_threshold, score\_threshold) selected\_boxes = tf.gather(boxes, selected\_indices)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* boxes: A 2-D float tensor of shape `[num_boxes, 4]`.
* scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).
* max\_output\_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
* iou\_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
* score\_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
| Constructors and Destructors |
| --- |
| `[NonMaxSuppressionV3](#classtensorflow_1_1ops_1_1_non_max_suppression_v3_1a17764bb3f4d7a6fa8f7f7b3c62510435)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v3_1a04f4f175f8c0cc6176fb555f9113418d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[selected\_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v3_1a31738ea2eda8ca1f5f7581f2379939c2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_non_max_suppression_v3_1a116c420004985181682d064631cf727c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_v3_1a218f159eb67ca2415aa5dfaf8d566aca)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_v3_1ad25f25b6aaeed58caf03e3adc092c5f7)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### selected\_indices
```
::tensorflow::Output selected_indices
```
Public functions
----------------
### NonMaxSuppressionV3
```
NonMaxSuppressionV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DepthwiseConv2dNativeBackpropFilter tensorflow::ops::DepthwiseConv2dNativeBackpropFilter
====================================================
`#include <nn_ops.h>`
Computes the gradients of depthwise convolution with respect to the filter.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape based on `data_format`. For example, if `data_format` is 'NHWC' then `input` is a 4-D `[batch, in_height, in_width, in_channels]` tensor.
* filter\_sizes: An integer vector representing the tensor shape of `filter`, where `filter` is a 4-D `[filter_height, filter_width, in_channels, depthwise_multiplier]` tensor.
* out\_backprop: 4-D with shape based on `data_format`. For example, if `data_format` is 'NHWC' then out\_backprop shape is `[batch, out_height, out_width, out_channels]`. Gradients w.r.t. the output of the convolution.
* strides: The stride of the sliding window for each dimension of the input of the convolution.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-filter/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width].
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. the `filter` input of the convolution.
| Constructors and Destructors |
| --- |
| `[DepthwiseConv2dNativeBackpropFilter](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1ac8ebaea238c8787ac4daaf6f66b88f71)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[DepthwiseConv2dNativeBackpropFilter](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1a8d5ba99844790ee7aaf95803727a2864)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding, const [DepthwiseConv2dNativeBackpropFilter::Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-filter/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1af96b02ca71f97b44c8eb5edd64d81128)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1aa25a466e97edf2eacda6b0d1a7d3e87b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1ade5b3fe29672b025a90bb9b06c9c8a65)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1ac70d3786ea0ba76b99ba1c47ea26c4b9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1a68b806738c3ff34c09290c80d79f2c0b)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1ac26c2c901d4f6f8c1ad0487d15c8e92f)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-filter/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1ae8033fc954a67d65a3821dc314848091)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-filter/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1ab7b8f10471f08e68537ca00ef7401566)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-filter/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native-backprop-filter/attrs) | Optional attribute setters for [DepthwiseConv2dNativeBackpropFilter](depthwise-conv2d-native-backprop-filter#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DepthwiseConv2dNativeBackpropFilter
```
DepthwiseConv2dNativeBackpropFilter(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter_sizes,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### DepthwiseConv2dNativeBackpropFilter
```
DepthwiseConv2dNativeBackpropFilter(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter_sizes,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const DepthwiseConv2dNativeBackpropFilter::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
tensorflow_cpp tensorflow::ops::LogicalNot tensorflow::ops::LogicalNot
===========================
`#include <math_ops.h>`
Returns the truth value of `NOT x` element-wise.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `bool`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `bool` with the same shape as `x`. The logical negation of `x`.
| Constructors and Destructors |
| --- |
| `[LogicalNot](#classtensorflow_1_1ops_1_1_logical_not_1a34f330d4808b884872f7e67a58a6c418)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_logical_not_1a5025e894e4494790d3837fa1c3aa9de5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_logical_not_1a77095ba308537d6a11e4062922cf06c1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_logical_not_1a6224f7ee143de52cebed8077e9c99589)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_logical_not_1a71478929563576866855a98a9b08560f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_logical_not_1af90c8749e60500d0f8efffb49811228c)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### LogicalNot
```
LogicalNot(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MapIncompleteSize tensorflow::ops::MapIncompleteSize
==================================
`#include <data_flow_ops.h>`
Op returns the number of incomplete elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The size tensor.
| Constructors and Destructors |
| --- |
| `[MapIncompleteSize](#classtensorflow_1_1ops_1_1_map_incomplete_size_1a514a04e10a5dff654c55bc2b8d738f54)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[MapIncompleteSize](#classtensorflow_1_1ops_1_1_map_incomplete_size_1a5ec4e0b572f11eeac709f0ec0f4cbe74)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [MapIncompleteSize::Attrs](../../../struct/tensorflow/ops/map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_map_incomplete_size_1af87b7b5d929a8e2c5fa1065670a57eab)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_map_incomplete_size_1ae6be11e77a25f37069c25a6a8584fbd8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_map_incomplete_size_1ad4b14d130d8645e9db51af019ba20be7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_map_incomplete_size_1af29ff92dc91d0e0e0999255176dae567)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_map_incomplete_size_1a42d1354a8aa0cb49fc8d3a7b419a2727)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_incomplete_size_1adeb17d94f639f9437b426c8c34c8c163)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_incomplete_size_1ae572217fd570b10529482a922199c832)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_incomplete_size_1a3c702f0c68f7ecf73577e0ab2bb463b2)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_incomplete_size_1a325f378c1d1dcb451ebe4c6bef3583c9)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapIncompleteSize::Attrs](../../../struct/tensorflow/ops/map-incomplete-size/attrs) | Optional attribute setters for [MapIncompleteSize](map-incomplete-size#classtensorflow_1_1ops_1_1_map_incomplete_size). |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### MapIncompleteSize
```
MapIncompleteSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### MapIncompleteSize
```
MapIncompleteSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const MapIncompleteSize::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Angle tensorflow::ops::Angle
======================
`#include <math_ops.h>`
Returns the argument of a complex number.
Summary
-------
Given a tensor `input` of complex numbers, this operation returns a tensor of type `float` that is the argument of each element in `input`. [All](all#classtensorflow_1_1ops_1_1_all) elements in `input` must be complex numbers of the form \(a + bj\), where *a* is the real part and *b* is the imaginary part.
The argument returned by this operation is of the form \(atan2(b, a)\).
For example:
```
# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
tf.angle(input) ==> [2.0132, 1.056]
```
(numpy) Equivalent to np.angle.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Angle](#classtensorflow_1_1ops_1_1_angle_1a47791ccc55af361ed20e9329be926cf6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[Angle](#classtensorflow_1_1ops_1_1_angle_1ad655869c197fdb8a1cc5080b72a87226)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [Angle::Attrs](../../../struct/tensorflow/ops/angle/attrs#structtensorflow_1_1ops_1_1_angle_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_angle_1a51298925de95397310ac4c715229c927)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_angle_1a45a029f66865271344ede680a3903795)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_angle_1a4cbf3eaf2f27c7a6a5fde00b9b46495a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_angle_1a3dbe5d6ed0e092b27882a34e24d61b6f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_angle_1a947b786764bea16a027c4ca59f06a205)() const` | |
| Public static functions |
| --- |
| `[Tout](#classtensorflow_1_1ops_1_1_angle_1a16753413cc04e4dcfac2ee2931c0e939)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/angle/attrs#structtensorflow_1_1ops_1_1_angle_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Angle::Attrs](../../../struct/tensorflow/ops/angle/attrs) | Optional attribute setters for [Angle](angle#classtensorflow_1_1ops_1_1_angle). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Angle
```
Angle(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### Angle
```
Angle(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const Angle::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Tout
```
Attrs Tout(
DataType x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::LogSoftmax tensorflow::ops::LogSoftmax
===========================
`#include <nn_ops.h>`
Computes log softmax activations.
Summary
-------
For each batch `i` and class `j` we have
```
logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i])))
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* logits: 2-D with shape `[batch_size, num_classes]`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same shape as `logits`.
| Constructors and Destructors |
| --- |
| `[LogSoftmax](#classtensorflow_1_1ops_1_1_log_softmax_1a73483652ac6fcd6e2162f224c5459235)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logits)` |
| Public attributes |
| --- |
| `[logsoftmax](#classtensorflow_1_1ops_1_1_log_softmax_1aaa7ca17002b410b0a6992c5f604a13a6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_log_softmax_1acb2eb968de24da07c71196bfd2da5e36)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_log_softmax_1a1ef7bed8e2017ceda2891e1568c32072)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_log_softmax_1ae15a3807bd29485ca7e6c0a0408bd656)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_log_softmax_1a38da28934ec15aab2813d6d074a25386)() const` | |
Public attributes
-----------------
### logsoftmax
```
::tensorflow::Output logsoftmax
```
### operation
```
Operation operation
```
Public functions
----------------
### LogSoftmax
```
LogSoftmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input logits
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Relu tensorflow::ops::Relu
=====================
`#include <nn_ops.h>`
Computes rectified linear: `max(features, 0)`.
Summary
-------
See: <https://en.wikipedia.org/wiki/Rectifier_(neural_networks)> Example usage: tf.nn.relu([-2., 0., 3.]).numpy() array([0., 0., 3.], dtype=float32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The activations tensor.
| Constructors and Destructors |
| --- |
| `[Relu](#classtensorflow_1_1ops_1_1_relu_1a7803b4543ea4326b15bc124318a0337d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_relu_1a8844d0073c49f446320702a327c3bc59)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_relu_1aa2b9226933d48b88974932125f5790c5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_relu_1a4aa527ed3a2a511b20af65389a580d7f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_relu_1adb54d55892d25f2861881dd18f013718)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_relu_1acdac2b75ed23e065a9ba239d8c70e090)() const` | |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### operation
```
Operation operation
```
Public functions
----------------
### Relu
```
Relu(
const ::tensorflow::Scope & scope,
::tensorflow::Input features
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::EncodePng tensorflow::ops::EncodePng
==========================
`#include <image_ops.h>`
PNG-encode an image.
Summary
-------
`image` is a 3-D uint8 or uint16 [Tensor](../tensor#classtensorflow_1_1_tensor) of shape `[height, width, channels]` where `channels` is:
* 1: for grayscale.
* 2: for grayscale + alpha.
* 3: for RGB.
* 4: for RGBA.
The ZLIB compression level, `compression`, can be -1 for the PNG-encoder default or a value from 0 to 9. 9 is the highest compression level, generating the smallest output, but is slower.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* image: 3-D with shape `[height, width, channels]`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/encode-png/attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs)`):
* compression: Compression level.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 0-D. PNG-encoded image.
| Constructors and Destructors |
| --- |
| `[EncodePng](#classtensorflow_1_1ops_1_1_encode_png_1a1dd56a89fbfdf0a35eb444d4342b2c7a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image)` |
| `[EncodePng](#classtensorflow_1_1ops_1_1_encode_png_1a3f8275d8de85c565db8baef06d518dfa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image, const [EncodePng::Attrs](../../../struct/tensorflow/ops/encode-png/attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[contents](#classtensorflow_1_1ops_1_1_encode_png_1aac6f3548cb8e0539d4e65ddba93ac4b0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_encode_png_1a3dd11638d8d7a6caa5c0151f099abff7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_encode_png_1a19512289f1f780298ec73b5fd6f54ce4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_encode_png_1aece039de4b9b0ff1b8b1462ceae15a1b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_encode_png_1ac1a34a63520602afd8ee1c203bc2ba30)() const` | |
| Public static functions |
| --- |
| `[Compression](#classtensorflow_1_1ops_1_1_encode_png_1ab763cfa8c279c172c2ee539abdad9338)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/encode-png/attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::EncodePng::Attrs](../../../struct/tensorflow/ops/encode-png/attrs) | Optional attribute setters for [EncodePng](encode-png#classtensorflow_1_1ops_1_1_encode_png). |
Public attributes
-----------------
### contents
```
::tensorflow::Output contents
```
### operation
```
Operation operation
```
Public functions
----------------
### EncodePng
```
EncodePng(
const ::tensorflow::Scope & scope,
::tensorflow::Input image
)
```
### EncodePng
```
EncodePng(
const ::tensorflow::Scope & scope,
::tensorflow::Input image,
const EncodePng::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Compression
```
Attrs Compression(
int64 x
)
```
tensorflow_cpp tensorflow::ops::TensorArray tensorflow::ops::TensorArray
============================
`#include <data_flow_ops.h>`
An array of Tensors of given size.
Summary
-------
Write data via Write and read via Read or Pack.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* size: The size of the array.
* dtype: The type of the elements on the tensor\_array.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)`):
* element\_shape: The expected shape of an element, if known. Used to validate the shapes of [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.
* dynamic\_size: A boolean that determines whether writes to the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size. By default, this is not allowed.
* clear\_after\_read: If true (default), Tensors in the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read. This disables multiple read semantics but allows early release of memory.
* identical\_element\_shapes: If true (default is false), then all elements in the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have identical shapes. This allows certain behaviors, like dynamically checking for consistent shapes on write, and being able to fill in properly shaped zero tensors on stack even if the element\_shape attribute is not fully defined.
* tensor\_array\_name: Overrides the name used for the temporary tensor\_array resource. Default value is the name of the '[TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array)' op (which is guaranteed unique).
Returns:
* `[Output](../output#classtensorflow_1_1_output)` handle: The handle to the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* `[Output](../output#classtensorflow_1_1_output)` flow: A scalar used to control gradient flow.
| Constructors and Destructors |
| --- |
| `[TensorArray](#classtensorflow_1_1ops_1_1_tensor_array_1a17fb1bdb76e98f8c83ec1cf24af87f3d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, DataType dtype)` |
| `[TensorArray](#classtensorflow_1_1ops_1_1_tensor_array_1afede14d69c65d1efdc36f5ac00fc6351)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, DataType dtype, const [TensorArray::Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[flow](#classtensorflow_1_1ops_1_1_tensor_array_1ac6f0c80567abf77dbae5528ef5257c3c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[handle](#classtensorflow_1_1ops_1_1_tensor_array_1a238401c92769f36d04f2f3b2db163fdf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_1a1b6149ac5da344ccb1561eefc5b0b25a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[ClearAfterRead](#classtensorflow_1_1ops_1_1_tensor_array_1ada85e1cd0c0611935f275655748441b6)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` |
| `[DynamicSize](#classtensorflow_1_1ops_1_1_tensor_array_1a3022cd4fccb5d056d0e670d51ad424b4)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` |
| `[ElementShape](#classtensorflow_1_1ops_1_1_tensor_array_1a4d87fc9eee4243549ee11e45bb697ba9)(PartialTensorShape x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` |
| `[IdenticalElementShapes](#classtensorflow_1_1ops_1_1_tensor_array_1a6e6597bdcb607f327ba2047f3dafa449)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` |
| `[TensorArrayName](#classtensorflow_1_1ops_1_1_tensor_array_1a26c71247662a164badad7ad3004f3409)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TensorArray::Attrs](../../../struct/tensorflow/ops/tensor-array/attrs) | Optional attribute setters for [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array). |
Public attributes
-----------------
### flow
```
::tensorflow::Output flow
```
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### TensorArray
```
TensorArray(
const ::tensorflow::Scope & scope,
::tensorflow::Input size,
DataType dtype
)
```
### TensorArray
```
TensorArray(
const ::tensorflow::Scope & scope,
::tensorflow::Input size,
DataType dtype,
const TensorArray::Attrs & attrs
)
```
Public static functions
-----------------------
### ClearAfterRead
```
Attrs ClearAfterRead(
bool x
)
```
### DynamicSize
```
Attrs DynamicSize(
bool x
)
```
### ElementShape
```
Attrs ElementShape(
PartialTensorShape x
)
```
### IdenticalElementShapes
```
Attrs IdenticalElementShapes(
bool x
)
```
### TensorArrayName
```
Attrs TensorArrayName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ImmutableConst tensorflow::ops::ImmutableConst
===============================
`#include <array_ops.h>`
Returns immutable tensor from memory region.
Summary
-------
The current implementation memmaps the tensor from a file.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* dtype: Type of the returned tensor.
* shape: Shape of the returned tensor.
* memory\_region\_name: Name of readonly memory region used by the tensor, see NewReadOnlyMemoryRegionFromFile in tensorflow::Env.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The tensor tensor.
| Constructors and Destructors |
| --- |
| `[ImmutableConst](#classtensorflow_1_1ops_1_1_immutable_const_1aab9e7185e34476fca15636e394313a6a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype, PartialTensorShape shape, StringPiece memory_region_name)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_immutable_const_1af488862c99460624515d6f46da0c4225)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[tensor](#classtensorflow_1_1ops_1_1_immutable_const_1aa8c0d0ee596f1a68b05557139dd85951)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_immutable_const_1af2b53b0f4adf62a117182f43d3270fd4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_immutable_const_1a5329938c0ad6a99babe75af3d3623f47)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_immutable_const_1aa79e1c2dd15e9de061013311d314a20d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### tensor
```
::tensorflow::Output tensor
```
Public functions
----------------
### ImmutableConst
```
ImmutableConst(
const ::tensorflow::Scope & scope,
DataType dtype,
PartialTensorShape shape,
StringPiece memory_region_name
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseSegmentSqrtN tensorflow::ops::SparseSegmentSqrtN
===================================
`#include <math_ops.h>`
Computes the sum along sparse segments of a tensor divided by the sqrt of N.
Summary
-------
N is the size of the segment being reduced.
See `tf.sparse.segment_sum` for usage examples.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: A 1-D tensor. Has same rank as `segment_ids`.
* segment\_ids: A 1-D tensor. Values should be sorted and can be repeated.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SparseSegmentSqrtN](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_1a40f8ad324c1d7f4dd4c3f768b107dc39)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_1ac6e04b8ae49c040d4fb78539251f732c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_1ad4bf36c9267e5d6245c5b1d143049272)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_1ad30c396ef181cd74984b1d23ff3bdee3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_1adbc1ac76f231ca09d1ba5df15369c510)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_1aba2d284339055dbd154009532a171823)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentSqrtN
```
SparseSegmentSqrtN(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input indices,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DebugGradientRefIdentity tensorflow::ops::DebugGradientRefIdentity
=========================================
`#include <array_ops.h>`
[Identity](identity#classtensorflow_1_1ops_1_1_identity) op for gradient debugging.
Summary
-------
This op is hidden from public in Python. It is used by TensorFlow Debugger to register gradient tensors for gradient debugging. This op operates on reference-type tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[DebugGradientRefIdentity](#classtensorflow_1_1ops_1_1_debug_gradient_ref_identity_1a8976926fbb550d843a8607e68219d213)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_debug_gradient_ref_identity_1a6d98d5d273b38ff189d0ae282ac8831c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_debug_gradient_ref_identity_1afd3019332f7780993d1f72cf266c11b0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_debug_gradient_ref_identity_1afcfa277d43949607dbe27046cf461fb1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_debug_gradient_ref_identity_1a26e4788c985bef18263a5d9c3556e832)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_debug_gradient_ref_identity_1a32018a1ed67dfc95d49c74b9ec5bd32a)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DebugGradientRefIdentity
```
DebugGradientRefIdentity(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::AssignAdd tensorflow::ops::AssignAdd
==========================
`#include <state_ops.h>`
Update 'ref' by adding 'value' to it.
Summary
-------
This operation outputs "ref" after the update is done. This makes it easier to chain operations that need to use the reset value.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* value: The value to be added to the variable.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/assign-add/attrs#structtensorflow_1_1ops_1_1_assign_add_1_1_attrs)`):
* use\_locking: If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been updated.
| Constructors and Destructors |
| --- |
| `[AssignAdd](#classtensorflow_1_1ops_1_1_assign_add_1aa91b47049ecb93fa5824ad36b535fcdd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` |
| `[AssignAdd](#classtensorflow_1_1ops_1_1_assign_add_1a496735ee41317a1738b5cb3e1786cce0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const [AssignAdd::Attrs](../../../struct/tensorflow/ops/assign-add/attrs#structtensorflow_1_1ops_1_1_assign_add_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_assign_add_1a45b7ce12f97e5f94dc8398bd60800389)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_assign_add_1ac8fb7dfee31efa93d3e0fd7a964eac0e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_assign_add_1a1e417cd25dea39879dcce25e01cdef03)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_assign_add_1aaa94aa69fe2183ce50f39c1de74fe054)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_assign_add_1acdbb3d9797d903a63d6f4899aa95b028)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_assign_add_1ad7216775028fbf1db75e7cbbedcd47b2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/assign-add/attrs#structtensorflow_1_1ops_1_1_assign_add_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AssignAdd::Attrs](../../../struct/tensorflow/ops/assign-add/attrs) | Optional attribute setters for [AssignAdd](assign-add#classtensorflow_1_1ops_1_1_assign_add). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### AssignAdd
```
AssignAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input value
)
```
### AssignAdd
```
AssignAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input value,
const AssignAdd::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyKerasMomentum tensorflow::ops::ResourceApplyKerasMomentum
===========================================
`#include <training_ops.h>`
Update '\*var' according to the momentum scheme.
Summary
-------
Set use\_nesterov = True if you want to use Nesterov momentum.
accum = accum \* momentum - lr \* grad var += accum
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* grad: The gradient.
* momentum: Momentum. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyKerasMomentum](#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1ac7e58311613d0d165a44cc1fba9e5153)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum)` |
| `[ResourceApplyKerasMomentum](#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1ac39d343d2b0d0b400490c36c574218bc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, const [ResourceApplyKerasMomentum::Attrs](../../../struct/tensorflow/ops/resource-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1aae1a5eea3a68d79bac0cd6e088e5ea20)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1a3c4e446369c8fd3251e9f3b66f4dcd99)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1aeba0a5e74d532e896644494ed4152e67)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1a6cac17bd849f55f2f12caf3f2d78ea85)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyKerasMomentum::Attrs](../../../struct/tensorflow/ops/resource-apply-keras-momentum/attrs) | Optional attribute setters for [ResourceApplyKerasMomentum](resource-apply-keras-momentum#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyKerasMomentum
```
ResourceApplyKerasMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input momentum
)
```
### ResourceApplyKerasMomentum
```
ResourceApplyKerasMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input momentum,
const ResourceApplyKerasMomentum::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
tensorflow_cpp tensorflow::ops::Erf tensorflow::ops::Erf
====================
`#include <math_ops.h>`
Computes the [Gauss error function](https://en.wikipedia.org/wiki/Error_function) of `x` element-wise.
Summary
-------
In statistics, for non-negative values of $x$, the error function has the following interpretation: for a random variable $Y$ that is normally distributed with mean 0 and variance $1/\sqrt{2}$, $erf(x)$ is the probability that $Y$ falls in the range $[−x, x]$.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Erf](#classtensorflow_1_1ops_1_1_erf_1ad1fb0bc8a3f8fbd92a9f449b931ca352)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_erf_1a9a56cbccfb63beaf1387d310c0dc2244)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_erf_1a3ae2e3c9bcaac0214b5482274552c135)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_erf_1a6db47a3956aafcf3552917cbe5bc840b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_erf_1a667ec0af69bfe951b05eb49f83e562a2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_erf_1afd0c6d0cbe45b49c6ef8981d5be99ba1)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Erf
```
Erf(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RefNextIteration tensorflow::ops::RefNextIteration
=================================
`#include <control_flow_ops.h>`
Makes its input available to the next iteration.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* data: The tensor to be made available to the next iteration.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The same tensor as `data`.
| Constructors and Destructors |
| --- |
| `[RefNextIteration](#classtensorflow_1_1ops_1_1_ref_next_iteration_1a6ed65a21a9bd88c476383090a571523b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ref_next_iteration_1a3230b3f4944619d1dfbeee35f1f0fa1e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_ref_next_iteration_1a8524504def617d8d279ebee5445ced13)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ref_next_iteration_1a4f453e1bb2238ac9574dda0332580429)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ref_next_iteration_1a88c9ee893e8e42900c4316a082721dc1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ref_next_iteration_1afabc3b907e49ca64151b662eeaa6f7c3)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RefNextIteration
```
RefNextIteration(
const ::tensorflow::Scope & scope,
::tensorflow::Input data
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ScatterUpdate tensorflow::ops::ScatterUpdate
==============================
`#include <state_ops.h>`
Applies sparse updates to a variable reference.
Summary
-------
This operation computes
```
# Scalar indices
ref[indices, ...] = updates[...]
```
```
# Vector indices (for each i)
ref[indices[i], ...] = updates[i, ...]
```
```
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
```
This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.
If values in `ref` is to be updated more than once, because there are duplicate entries in `indices`, the order at which the updates happen for each value is undefined.
Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.

See also `tf.batch_scatter_update` and `tf.scatter_nd_update`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* indices: A tensor of indices into the first dimension of `ref`.
* updates: A tensor of updated values to store in `ref`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-update/attrs#structtensorflow_1_1ops_1_1_scatter_update_1_1_attrs)`):
* use\_locking: If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterUpdate](#classtensorflow_1_1ops_1_1_scatter_update_1af11a28f7f16034316972ca7af5300091)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterUpdate](#classtensorflow_1_1ops_1_1_scatter_update_1a24930d0359067d34acd2eb9909cb7284)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterUpdate::Attrs](../../../struct/tensorflow/ops/scatter-update/attrs#structtensorflow_1_1ops_1_1_scatter_update_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_update_1a947a92603c1a76d79f820bcfbd770085)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_update_1a3393017bac00574a56c1e9dbfa571e13)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_update_1ae8ab84fd6c4d480a1e0d0f7b5ddf0511)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_update_1a001e1fa15db57c166861b2299d0eb2dc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_update_1a06922deb16980eff51b1ca3d6474285a)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_update_1a2c494808116c7f942974b90f363d323f)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-update/attrs#structtensorflow_1_1ops_1_1_scatter_update_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterUpdate::Attrs](../../../struct/tensorflow/ops/scatter-update/attrs) | Optional attribute setters for [ScatterUpdate](scatter-update#classtensorflow_1_1ops_1_1_scatter_update). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterUpdate
```
ScatterUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterUpdate
```
ScatterUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterUpdate::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::ParseTensor tensorflow::ops::ParseTensor
============================
`#include <parsing_ops.h>`
Transforms a serialized tensorflow.TensorProto proto into a [Tensor](../tensor#classtensorflow_1_1_tensor).
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A scalar string containing a serialized TensorProto proto.
* out\_type: The type of the serialized tensor. The provided type must match the type of the serialized tensor and no implicit conversion will take place.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) of type `out_type`.
| Constructors and Destructors |
| --- |
| `[ParseTensor](#classtensorflow_1_1ops_1_1_parse_tensor_1a360c456d58375c9e042c8459f8bbe957)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, DataType out_type)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_parse_tensor_1a1e652fe9fabb9e096c73871885022fd2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_parse_tensor_1a81b7c4f3bbd232119e50c0ef415c3aea)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_parse_tensor_1afccc539562b57c7ca8dff47b92e2ba2d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_parse_tensor_1ace22bac1251403dca44a6d8a4e5a4331)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_parse_tensor_1abc18a32e825dcb21287920c6701984ca)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ParseTensor
```
ParseTensor(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
DataType out_type
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Dilation2DBackpropInput tensorflow::ops::Dilation2DBackpropInput
========================================
`#include <nn_ops.h>`
Computes the gradient of morphological 2-D dilation with respect to the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, in_height, in_width, depth]`.
* filter: 3-D with shape `[filter_height, filter_width, depth]`.
* out\_backprop: 4-D with shape `[batch, out_height, out_width, depth]`.
* strides: 1-D of length 4. The stride of the sliding window for each dimension of the input tensor. Must be: `[1, stride_height, stride_width, 1]`.
* rates: 1-D of length 4. The input stride for atrous morphological dilation. Must be: `[1, rate_height, rate_width, 1]`.
* padding: The type of padding algorithm to use.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, in_height, in_width, depth]`.
| Constructors and Destructors |
| --- |
| `[Dilation2DBackpropInput](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_input_1a656665a13419870e177ca6b67a869f31)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, const gtl::ArraySlice< int > & rates, StringPiece padding)` |
| Public attributes |
| --- |
| `[in\_backprop](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_input_1a40353e552051aa8801ef9f9ad4efc15c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_input_1a02412d298e84e41cd1bd2a21b9a064f4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_input_1ab58e7a7ffead7f2dd0dcc062204f47f8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_input_1a4ad020555d5b8ffc10bdf49956232358)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_input_1a8029c3562d2413ed5a8b249933690e32)() const` | |
Public attributes
-----------------
### in\_backprop
```
::tensorflow::Output in_backprop
```
### operation
```
Operation operation
```
Public functions
----------------
### Dilation2DBackpropInput
```
Dilation2DBackpropInput(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
const gtl::ArraySlice< int > & rates,
StringPiece padding
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ApplyAddSign tensorflow::ops::ApplyAddSign
=============================
`#include <training_ops.h>`
Update '\*var' according to the AddSign update.
Summary
-------
m\_t <- beta1 \* m\_{t-1} + (1 - beta1) \* g update <- (alpha + sign\_decay \* sign(g) \*sign(m)) \* g variable <- variable - lr\_t \* update
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* alpha: Must be a scalar.
* sign\_decay: Must be a scalar.
* beta: Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-add-sign/attrs#structtensorflow_1_1ops_1_1_apply_add_sign_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyAddSign](#classtensorflow_1_1ops_1_1_apply_add_sign_1af9f940a5ce219f006dd5784273581462)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyAddSign](#classtensorflow_1_1ops_1_1_apply_add_sign_1a8ced306386cbe8552a1acb0c7c9f7640)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyAddSign::Attrs](../../../struct/tensorflow/ops/apply-add-sign/attrs#structtensorflow_1_1ops_1_1_apply_add_sign_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_add_sign_1a2f3006bfafb719f77fb48b78d7ea9db3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_add_sign_1a7880929b8fb7c7581f00030a85654100)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_add_sign_1a71f7d03f4328c2e8d1901785967d44b3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_add_sign_1a92da05431d90f30e0785c8a850de7b3e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_add_sign_1ac1522c1a1317ddde43e2198c6d6c0337)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_add_sign_1aca5db7b5467a9f8cfed7c32dd6bd9c53)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-add-sign/attrs#structtensorflow_1_1ops_1_1_apply_add_sign_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyAddSign::Attrs](../../../struct/tensorflow/ops/apply-add-sign/attrs) | Optional attribute setters for [ApplyAddSign](apply-add-sign#classtensorflow_1_1ops_1_1_apply_add_sign). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyAddSign
```
ApplyAddSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input alpha,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad
)
```
### ApplyAddSign
```
ApplyAddSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input alpha,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad,
const ApplyAddSign::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::ApplyGradientDescent tensorflow::ops::ApplyGradientDescent
=====================================
`#include <training_ops.h>`
Update '\*var' by subtracting 'alpha' \* 'delta' from it.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* alpha: Scaling factor. Must be a scalar.
* delta: The change.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-gradient-descent/attrs#structtensorflow_1_1ops_1_1_apply_gradient_descent_1_1_attrs)`):
* use\_locking: If `True`, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyGradientDescent](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1a02b0cff378acff6764175510a30da2de)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta)` |
| `[ApplyGradientDescent](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1a0bee68dd467ecfbc96a8db3f401c8fb7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta, const [ApplyGradientDescent::Attrs](../../../struct/tensorflow/ops/apply-gradient-descent/attrs#structtensorflow_1_1ops_1_1_apply_gradient_descent_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1ae5abbeb9d43a7b58a2cf4d2c444f53fe)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1ad7a25f5c2c7a6e4ca3b2222a1c45777d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1a88b00c9b817da89da01dfaabd1750195)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1a972466fa3ea4e78b0abae2469a835a5e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1a393c4dc9ad66b888ccf8beb68f594751)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_gradient_descent_1a3751c29f150babe6104c53aec88f5419)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-gradient-descent/attrs#structtensorflow_1_1ops_1_1_apply_gradient_descent_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyGradientDescent::Attrs](../../../struct/tensorflow/ops/apply-gradient-descent/attrs) | Optional attribute setters for [ApplyGradientDescent](apply-gradient-descent#classtensorflow_1_1ops_1_1_apply_gradient_descent). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyGradientDescent
```
ApplyGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input delta
)
```
### ApplyGradientDescent
```
ApplyGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input delta,
const ApplyGradientDescent::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::QuantizedRelu tensorflow::ops::QuantizedRelu
==============================
`#include <nn_ops.h>`
Computes Quantized Rectified Linear: `max(features, 0)`
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_features: The float value that the lowest quantized value represents.
* max\_features: The float value that the highest quantized value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` activations: Has the same output shape as "features".
* `[Output](../output#classtensorflow_1_1_output)` min\_activations: The float value that the lowest quantized value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_activations: The float value that the highest quantized value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedRelu](#classtensorflow_1_1ops_1_1_quantized_relu_1a5e0ded07ba3f7153a1fd2e8c4c9c0216)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_features)` |
| `[QuantizedRelu](#classtensorflow_1_1ops_1_1_quantized_relu_1a0ab4441e9d7f69037c5025e86c8f788f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_features, const [QuantizedRelu::Attrs](../../../struct/tensorflow/ops/quantized-relu/attrs#structtensorflow_1_1ops_1_1_quantized_relu_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_quantized_relu_1a02d03a3b17e4effc4ecfacc918af94aa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[max\_activations](#classtensorflow_1_1ops_1_1_quantized_relu_1a4d8de642f5ac09db0028d525ac65ac20)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_activations](#classtensorflow_1_1ops_1_1_quantized_relu_1a284154376c40954f461a7f12337dda9c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_relu_1a43b2894a63c8973dff9ba7300efed1c7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[OutType](#classtensorflow_1_1ops_1_1_quantized_relu_1aea716e4dc2073aaa2cf530fa34709491)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-relu/attrs#structtensorflow_1_1ops_1_1_quantized_relu_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedRelu::Attrs](../../../struct/tensorflow/ops/quantized-relu/attrs) | Optional attribute setters for [QuantizedRelu](quantized-relu#classtensorflow_1_1ops_1_1_quantized_relu). |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### max\_activations
```
::tensorflow::Output max_activations
```
### min\_activations
```
::tensorflow::Output min_activations
```
### operation
```
Operation operation
```
Public functions
----------------
### QuantizedRelu
```
QuantizedRelu(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input min_features,
::tensorflow::Input max_features
)
```
### QuantizedRelu
```
QuantizedRelu(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input min_features,
::tensorflow::Input max_features,
const QuantizedRelu::Attrs & attrs
)
```
Public static functions
-----------------------
### OutType
```
Attrs OutType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::FixedLengthRecordReader tensorflow::ops::FixedLengthRecordReader
========================================
`#include <io_ops.h>`
A Reader that outputs fixed-length records from a file.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* record\_bytes: Number of bytes in the record.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)`):
* header\_bytes: Number of bytes in the header, defaults to 0.
* footer\_bytes: Number of bytes in the footer, defaults to 0.
* hop\_bytes: Number of bytes to hop before each read. Default of 0 means using record\_bytes.
* container: If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead.
* encoding: The type of encoding for the file. Currently ZLIB and GZIP are supported. Defaults to none.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to reference the Reader.
| Constructors and Destructors |
| --- |
| `[FixedLengthRecordReader](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1aa6ad72f08d89016af3043f72912d11eb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, int64 record_bytes)` |
| `[FixedLengthRecordReader](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a6951f2cbfe13b445b6a134ce78fe77c1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, int64 record_bytes, const [FixedLengthRecordReader::Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a0c935fca537ef7bcdf2a50360d8fbd5b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reader\_handle](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a00481a6bc3fe0179015426e24fc5e3c2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a2c1856b76a5e730a35dda4b05ab36554)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1ad939f43d11646484e2b9d7415ede5f46)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1ac225045293aca5f7d8f09bbdbc233a41)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1aed436fcc075716b55de242a06c31d66e)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` |
| `[Encoding](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a3ff28d9038bbd2ff938d63ce611249c4)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` |
| `[FooterBytes](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1acf06e389c6e04efa9e481214fea4c994)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` |
| `[HeaderBytes](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a22257b324b398ad5b5a7a5f5fee189a4)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` |
| `[HopBytes](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1af4f10340eb21642925af29b97ee7fa0d)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_fixed_length_record_reader_1a6adaddff1f2c88d557e6b7ffbb638d66)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FixedLengthRecordReader::Attrs](../../../struct/tensorflow/ops/fixed-length-record-reader/attrs) | Optional attribute setters for [FixedLengthRecordReader](fixed-length-record-reader#classtensorflow_1_1ops_1_1_fixed_length_record_reader). |
Public attributes
-----------------
### operation
```
Operation operation
```
### reader\_handle
```
::tensorflow::Output reader_handle
```
Public functions
----------------
### FixedLengthRecordReader
```
FixedLengthRecordReader(
const ::tensorflow::Scope & scope,
int64 record_bytes
)
```
### FixedLengthRecordReader
```
FixedLengthRecordReader(
const ::tensorflow::Scope & scope,
int64 record_bytes,
const FixedLengthRecordReader::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### Encoding
```
Attrs Encoding(
StringPiece x
)
```
### FooterBytes
```
Attrs FooterBytes(
int64 x
)
```
### HeaderBytes
```
Attrs HeaderBytes(
int64 x
)
```
### HopBytes
```
Attrs HopBytes(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxArgs tensorflow::ops::FakeQuantWithMinMaxArgs
========================================
`#include <array_ops.h>`
Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type.
Summary
-------
Attributes
* `[min; max]` define the clamping range for the `inputs` data.
* `inputs` values are quantized into the quantization range ( `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` when it is true) and then de-quantized and output as floats in `[min; max]` interval.
* `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.
Before quantization, `min` and `max` values are adjusted with the following logic. It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, the behavior can be unexpected:
* If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`.
* If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`.
* If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1)`, `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`.
Quantization is called fake since the output is still in floating point.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The outputs tensor.
| Constructors and Destructors |
| --- |
| `[FakeQuantWithMinMaxArgs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a85e03d1dc3cd4bc32cd221b7b9cf6d9a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs)` |
| `[FakeQuantWithMinMaxArgs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a5a50c94e0d72103df198cd3f00bed13d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, const [FakeQuantWithMinMaxArgs::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a74ebb70c787d9ab49c7e4f6a25a1caba)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[outputs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a9f9cb032ade7705f0b4a03b0ab94cb0c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1adf0a81f8d2e49f0bf4eb5859fac39168)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a51cf8e44b3b26ce30a5016a440b99c69)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a614548643c093eefd86990ce72baece3)() const` | |
| Public static functions |
| --- |
| `[Max](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a5e82983f6429be0078510aea65c1593b)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` |
| `[Min](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a3fd5bd826632651830791d26c59fb56f)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a9af5fd9211a71acf844cf8d911fde2ac)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1a80f557e9c790845a7e5c910bae0ef5fd)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args/attrs) | Optional attribute setters for [FakeQuantWithMinMaxArgs](fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args). |
Public attributes
-----------------
### operation
```
Operation operation
```
### outputs
```
::tensorflow::Output outputs
```
Public functions
----------------
### FakeQuantWithMinMaxArgs
```
FakeQuantWithMinMaxArgs(
const ::tensorflow::Scope & scope,
::tensorflow::Input inputs
)
```
### FakeQuantWithMinMaxArgs
```
FakeQuantWithMinMaxArgs(
const ::tensorflow::Scope & scope,
::tensorflow::Input inputs,
const FakeQuantWithMinMaxArgs::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Max
```
Attrs Max(
float x
)
```
### Min
```
Attrs Min(
float x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::OrderedMapClear tensorflow::ops::OrderedMapClear
================================
`#include <data_flow_ops.h>`
Op removes all elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[OrderedMapClear](#classtensorflow_1_1ops_1_1_ordered_map_clear_1a3f18f055018ca430a494d4da26c5527b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[OrderedMapClear](#classtensorflow_1_1ops_1_1_ordered_map_clear_1a95101f46c4793e0a41c4a2268c750d4e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [OrderedMapClear::Attrs](../../../struct/tensorflow/ops/ordered-map-clear/attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ordered_map_clear_1a854bd4ba0523d40747ba759b5a003fad)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_ordered_map_clear_1a541e322b1f03c88bcaef4d68bc8753de)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_clear_1ad958c6eb09fb5b2026a76fba0596cb3a)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-clear/attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_ordered_map_clear_1a8ee5a4a947181a47cde61909baba00e2)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-clear/attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_clear_1a0b385b0057dd840bb9e18096512c5511)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-clear/attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_clear_1ab924ee96a4ec9a8ad9d46015312a832b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-clear/attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OrderedMapClear::Attrs](../../../struct/tensorflow/ops/ordered-map-clear/attrs) | Optional attribute setters for [OrderedMapClear](ordered-map-clear#classtensorflow_1_1ops_1_1_ordered_map_clear). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### OrderedMapClear
```
OrderedMapClear(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### OrderedMapClear
```
OrderedMapClear(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const OrderedMapClear::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseAddGrad tensorflow::ops::SparseAddGrad
==============================
`#include <sparse_ops.h>`
The gradient operator for the [SparseAdd](sparse-add#classtensorflow_1_1ops_1_1_sparse_add) op.
Summary
-------
The [SparseAdd](sparse-add#classtensorflow_1_1ops_1_1_sparse_add) op calculates A + B, where A, B, and the sum are all represented as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. non-empty values of the sum, and outputs the gradients w.r.t. the non-empty values of A and B.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* backprop\_val\_grad: 1-D with shape `[nnz(sum)]`. The gradient with respect to the non-empty values of the sum.
* a\_indices: 2-D. The `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`.
* b\_indices: 2-D. The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`.
* sum\_indices: 2-D. The `indices` of the sum `SparseTensor`, size `[nnz(sum), ndims]`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` a\_val\_grad: 1-D with shape `[nnz(A)]`. The gradient with respect to the non-empty values of A.
* `[Output](../output#classtensorflow_1_1_output)` b\_val\_grad: 1-D with shape `[nnz(B)]`. The gradient with respect to the non-empty values of B.
| Constructors and Destructors |
| --- |
| `[SparseAddGrad](#classtensorflow_1_1ops_1_1_sparse_add_grad_1abbcde91fb7e908ec0479c7f47b13e1c5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) backprop_val_grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sum_indices)` |
| Public attributes |
| --- |
| `[a\_val\_grad](#classtensorflow_1_1ops_1_1_sparse_add_grad_1a93a1ecb35e9a570a0ce07d6b64c378d3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[b\_val\_grad](#classtensorflow_1_1ops_1_1_sparse_add_grad_1a89ccb278507678ca1a3ac465ccdf2613)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_add_grad_1a0ae3fb6459f86ab238ee9d3705c33994)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### a\_val\_grad
```
::tensorflow::Output a_val_grad
```
### b\_val\_grad
```
::tensorflow::Output b_val_grad
```
### operation
```
Operation operation
```
Public functions
----------------
### SparseAddGrad
```
SparseAddGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input backprop_val_grad,
::tensorflow::Input a_indices,
::tensorflow::Input b_indices,
::tensorflow::Input sum_indices
)
```
tensorflow_cpp tensorflow::ops::ReaderSerializeState tensorflow::ops::ReaderSerializeState
=====================================
`#include <io_ops.h>`
Produce a string tensor that encodes the state of a Reader.
Summary
-------
Not all Readers support being serialized, so this can produce an Unimplemented error.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a Reader.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The state tensor.
| Constructors and Destructors |
| --- |
| `[ReaderSerializeState](#classtensorflow_1_1ops_1_1_reader_serialize_state_1abebe1442352460b580c9f4218e370935)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reader_serialize_state_1a0c2348f5d68614195bb7508ff1e86787)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[state](#classtensorflow_1_1ops_1_1_reader_serialize_state_1a4e6d33498c737b9f2de27d964f60e06f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_reader_serialize_state_1a143057de010af956174db48cdc1209a2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_reader_serialize_state_1a322f2324c9686c7b2d5a32e099cd6b08)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_reader_serialize_state_1a326702ef6b459d214d33fc3167773761)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### state
```
::tensorflow::Output state
```
Public functions
----------------
### ReaderSerializeState
```
ReaderSerializeState(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::EuclideanNorm tensorflow::ops::EuclideanNorm
==============================
`#include <math_ops.h>`
Computes the euclidean norm of elements across dimensions of a tensor.
Summary
-------
Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The tensor to reduce.
* axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/euclidean-norm/attrs#structtensorflow_1_1ops_1_1_euclidean_norm_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor.
| Constructors and Destructors |
| --- |
| `[EuclideanNorm](#classtensorflow_1_1ops_1_1_euclidean_norm_1ad96a126c59e864a7aaa3ab3cd313273a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[EuclideanNorm](#classtensorflow_1_1ops_1_1_euclidean_norm_1a995101f70b7895e10937291accc5886e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [EuclideanNorm::Attrs](../../../struct/tensorflow/ops/euclidean-norm/attrs#structtensorflow_1_1ops_1_1_euclidean_norm_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_euclidean_norm_1a5ae15c96faa67ad8305c7665de6b345e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_euclidean_norm_1a7d8a7cf02839cdddf74d59f1f5da6c90)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_euclidean_norm_1a69ca3e7c52e209a54e6a625f950090bf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_euclidean_norm_1af43d94b3da8359a70678f274dc9b6d55)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_euclidean_norm_1a642cbc335a48a890ebb975de49cab8ad)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_euclidean_norm_1a0eb53b9fc1abe872ed5db5dee0d2db76)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/euclidean-norm/attrs#structtensorflow_1_1ops_1_1_euclidean_norm_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::EuclideanNorm::Attrs](../../../struct/tensorflow/ops/euclidean-norm/attrs) | Optional attribute setters for [EuclideanNorm](euclidean-norm#classtensorflow_1_1ops_1_1_euclidean_norm). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### EuclideanNorm
```
EuclideanNorm(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis
)
```
### EuclideanNorm
```
EuclideanNorm(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis,
const EuclideanNorm::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::MaxPool3DGrad tensorflow::ops::MaxPool3DGrad
==============================
`#include <nn_ops.h>`
Computes gradients of 3D max pooling function.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* orig\_input: The original input tensor.
* orig\_output: The original output tensor.
* grad: [Output](../output#classtensorflow_1_1_output) backprop of shape `[batch, depth, rows, cols, channels]`.
* ksize: 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have `ksize[0] = ksize[4] = 1`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[MaxPool3DGrad](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1a05674c5126e06f5b33e87233f59901d7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPool3DGrad](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1a4bc219b5c3f10c4d5a9092a999866e3e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPool3DGrad::Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1ae3fefa208dbc3958208e5e060e4b71de)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1a85663a2213c5a89d41ecca2677ef8b43)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1a80e4a43345bff4add4ba6148719cf539)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1a012b944016984cf71a26efa65a84bc66)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1ade03961a1c35343ac9a97fdaf17880eb)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_1a3bb08e05ed5ccdd98f71ccbe64ccb8c0)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPool3DGrad::Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad/attrs) | Optional attribute setters for [MaxPool3DGrad](max-pool3-d-grad#classtensorflow_1_1ops_1_1_max_pool3_d_grad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPool3DGrad
```
MaxPool3DGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input,
::tensorflow::Input orig_output,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPool3DGrad
```
MaxPool3DGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input,
::tensorflow::Input orig_output,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPool3DGrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Abort tensorflow::ops::Abort
======================
`#include <control_flow_ops.h>`
Raise a exception to abort the process when called.
Summary
-------
If exit\_without\_error is true, the process will exit normally, otherwise it will exit with a SIGABORT signal.
Returns nothing but an exception.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/abort/attrs#structtensorflow_1_1ops_1_1_abort_1_1_attrs)`):
* error\_msg: A string which is the message associated with the exception.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[Abort](#classtensorflow_1_1ops_1_1_abort_1ae3e887b2d01e7ca0d7b542402fb6109c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| `[Abort](#classtensorflow_1_1ops_1_1_abort_1a454530dc73efb0c918895564c3a1c3aa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const [Abort::Attrs](../../../struct/tensorflow/ops/abort/attrs#structtensorflow_1_1ops_1_1_abort_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_abort_1a03764bd8e9c8d8208fb5326499a82414)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_abort_1a81e311c61ceced865499b5c3a685a974)() const` | |
| Public static functions |
| --- |
| `[ErrorMsg](#classtensorflow_1_1ops_1_1_abort_1a93fa562bb7d000cf7568e9995a67757b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/abort/attrs#structtensorflow_1_1ops_1_1_abort_1_1_attrs)` |
| `[ExitWithoutError](#classtensorflow_1_1ops_1_1_abort_1af4eb7322975126f0aeb2fee41d05ddd9)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/abort/attrs#structtensorflow_1_1ops_1_1_abort_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Abort::Attrs](../../../struct/tensorflow/ops/abort/attrs) | Optional attribute setters for [Abort](abort#classtensorflow_1_1ops_1_1_abort). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### Abort
```
Abort(
const ::tensorflow::Scope & scope
)
```
### Abort
```
Abort(
const ::tensorflow::Scope & scope,
const Abort::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### ErrorMsg
```
Attrs ErrorMsg(
StringPiece x
)
```
### ExitWithoutError
```
Attrs ExitWithoutError(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseSegmentSqrtNGrad tensorflow::ops::SparseSegmentSqrtNGrad
=======================================
`#include <math_ops.h>`
Computes gradients for [SparseSegmentSqrtN](sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n).
Summary
-------
Returns tensor "output" with same shape as grad, except for dimension 0 whose value is output\_dim0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* grad: gradient propagated to the [SparseSegmentSqrtN](sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n) op.
* indices: indices passed to the corresponding [SparseSegmentSqrtN](sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n) op.
* segment\_ids: segment\_ids passed to the corresponding [SparseSegmentSqrtN](sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n) op.
* output\_dim0: dimension 0 of "data" passed to [SparseSegmentSqrtN](sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n) op.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[SparseSegmentSqrtNGrad](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_grad_1ac363c25609d92a978f2bed20e7158d7d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) output_dim0)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_grad_1adc740c2bdbfb85a7cece2be4ba75a241)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_grad_1a9526b27520b71dd075562b89d23f6d6b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_grad_1a7abd7aef89700566de441da2af17a1cd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_grad_1a6bd942a2caf61e2d8a9cf1be8e20f538)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n_grad_1a5375b4db84448412e2ff0bf2e7e00afb)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentSqrtNGrad
```
SparseSegmentSqrtNGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input segment_ids,
::tensorflow::Input output_dim0
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResourceApplyMomentum tensorflow::ops::ResourceApplyMomentum
======================================
`#include <training_ops.h>`
Update '\*var' according to the momentum scheme.
Summary
-------
Set use\_nesterov = True if you want to use Nesterov momentum.
accum = accum \* momentum + grad var -= lr \* accum
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* grad: The gradient.
* momentum: Momentum. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyMomentum](#classtensorflow_1_1ops_1_1_resource_apply_momentum_1aa2dffa322d4ed2a027c546db3c2cc9f0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum)` |
| `[ResourceApplyMomentum](#classtensorflow_1_1ops_1_1_resource_apply_momentum_1aaabab8ab9b7e779d819219175b3d01ab)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, const [ResourceApplyMomentum::Attrs](../../../struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_momentum_1a9a0f9cac558c342e56f0a2d2dcdecd29)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_momentum_1aad4acd0b17f234ebb7f401abe0b1415b)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_momentum_1a5d328ef958f0a6b9ddd3adc98da54e30)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_resource_apply_momentum_1ac1b137ccfdbf8b69e2ffe35db22e7787)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyMomentum::Attrs](../../../struct/tensorflow/ops/resource-apply-momentum/attrs) | Optional attribute setters for [ResourceApplyMomentum](resource-apply-momentum#classtensorflow_1_1ops_1_1_resource_apply_momentum). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyMomentum
```
ResourceApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input momentum
)
```
### ResourceApplyMomentum
```
ResourceApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input momentum,
const ResourceApplyMomentum::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
tensorflow_cpp tensorflow::ops::MatrixBandPart tensorflow::ops::MatrixBandPart
===============================
`#include <array_ops.h>`
Copy a tensor setting everything outside a central band in each innermost matrix to zero.
Summary
-------
The `band` part is computed as follows: Assume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a tensor with the same shape where
`band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]`.
The indicator function
`in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) && (num_upper < 0 || (n-m) <= num_upper)`.
For example:
```
# if 'input' is [[ 0, 1, 2, 3]
# [-1, 0, 1, 2]
# [-2, -1, 0, 1]
# [-3, -2, -1, 0]],
```
```
tf.linalg.band_part(input, 1, -1) ==> [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[ 0, -1, 0, 1]
[ 0, 0, -1, 0]],
```
```
tf.linalg.band_part(input, 2, 1) ==> [[ 0, 1, 0, 0]
[-1, 0, 1, 0]
[-2, -1, 0, 1]
[ 0, -2, -1, 0]]
```
Useful special cases:
```
tf.linalg.band_part(input, 0, -1) ==> Upper triangular part.
tf.linalg.band_part(input, -1, 0) ==> Lower triangular part.
tf.linalg.band_part(input, 0, 0) ==> Diagonal.
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `k` tensor.
* num\_lower: 0-D tensor. Number of subdiagonals to keep. If negative, keep entire lower triangle.
* num\_upper: 0-D tensor. Number of superdiagonals to keep. If negative, keep entire upper triangle.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Rank `k` tensor of the same shape as input. The extracted banded tensor.
| Constructors and Destructors |
| --- |
| `[MatrixBandPart](#classtensorflow_1_1ops_1_1_matrix_band_part_1aafbd4f5790f99aabe649a2603fab5026)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_lower, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_upper)` |
| Public attributes |
| --- |
| `[band](#classtensorflow_1_1ops_1_1_matrix_band_part_1a19ddd7640d84cfeb55298dcd2d150a8c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_band_part_1a7f11fcb9cf1a97f13cded627a9579305)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_band_part_1a7a9ecf47b2def85ed1a8e7ab08dfe008)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_band_part_1a1b6a750bbd105a89c4ef9a398ccf7cf1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_band_part_1a2be19e72aeddcea40f0be7cc6d6fdf97)() const` | |
Public attributes
-----------------
### band
```
::tensorflow::Output band
```
### operation
```
Operation operation
```
Public functions
----------------
### MatrixBandPart
```
MatrixBandPart(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input num_lower,
::tensorflow::Input num_upper
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::GetSessionTensor tensorflow::ops::GetSessionTensor
=================================
`#include <data_flow_ops.h>`
Get the value of the tensor specified by its handle.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle for a tensor stored in the session state.
* dtype: The type of the output value.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The tensor for the given handle.
| Constructors and Destructors |
| --- |
| `[GetSessionTensor](#classtensorflow_1_1ops_1_1_get_session_tensor_1a128f08844c9dd6988387b680ef27c241)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, DataType dtype)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_get_session_tensor_1ac52263ad5787ac6ce2af23a947e789f8)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[value](#classtensorflow_1_1ops_1_1_get_session_tensor_1a371ba0f0f7a7ce91b7589c1aa0457721)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_get_session_tensor_1ad68df27fcc8a1fcf71ecdc304ca2e066)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_get_session_tensor_1a663fecdbf33e30201d8133a4e1d1232f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_get_session_tensor_1a8b38c11d93a868ea6f48ebc5cd815bdc)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### value
```
::tensorflow::Output value
```
Public functions
----------------
### GetSessionTensor
```
GetSessionTensor(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
DataType dtype
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Cumprod tensorflow::ops::Cumprod
========================
`#include <math_ops.h>`
Compute the cumulative product of the tensor `x` along `axis`.
Summary
-------
By default, this op performs an inclusive cumprod, which means that the first element of the input is identical to the first element of the output:
```
tf.cumprod([a, b, c]) # => [a, a * b, a * b * c]
```
By setting the `exclusive` kwarg to `True`, an exclusive cumprod is performed instead:
```
tf.cumprod([a, b, c], exclusive=True) # => [1, a, a * b]
```
By setting the `reverse` kwarg to `True`, the cumprod is performed in the opposite direction:
```
tf.cumprod([a, b, c], reverse=True) # => [a * b * c, b * c, c]
```
This is more efficient than using separate `tf.reverse` ops.
The `reverse` and `exclusive` kwargs can also be combined:
```
tf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A `[Tensor](../tensor#classtensorflow_1_1_tensor)`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, `complex128`, `qint8`, `quint8`, `qint32`, `half`.
* axis: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `int32` (default: 0). Must be in the range `[-rank(x), rank(x))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)`):
* exclusive: If `True`, perform exclusive cumprod.
* reverse: A `bool` (default: False).
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The out tensor.
| Constructors and Destructors |
| --- |
| `[Cumprod](#classtensorflow_1_1ops_1_1_cumprod_1a5cf5eb762b0a395c784265be34cefca9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[Cumprod](#classtensorflow_1_1ops_1_1_cumprod_1af028aab7f34ea1aba5dd296b8cb2fdbc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Cumprod::Attrs](../../../struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_cumprod_1a15918749b2c6a95b59853778fb5a449e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_cumprod_1a993dbcb13834ecd895a4009ba5bdfb48)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_cumprod_1abd920e1da9ceb0d441bb10250cc860cd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cumprod_1adc26a397e6b980247abf7fd333c0f389)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cumprod_1acab6e7e1ab4245028ef1b8625859757a)() const` | |
| Public static functions |
| --- |
| `[Exclusive](#classtensorflow_1_1ops_1_1_cumprod_1aa8984f96042955a9b2c08528a49df924)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)` |
| `[Reverse](#classtensorflow_1_1ops_1_1_cumprod_1aafe8da11faadd6cca28c310fac8aec6d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/cumprod/attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Cumprod::Attrs](../../../struct/tensorflow/ops/cumprod/attrs) | Optional attribute setters for [Cumprod](cumprod#classtensorflow_1_1ops_1_1_cumprod). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### Cumprod
```
Cumprod(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input axis
)
```
### Cumprod
```
Cumprod(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input axis,
const Cumprod::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Exclusive
```
Attrs Exclusive(
bool x
)
```
### Reverse
```
Attrs Reverse(
bool x
)
```
tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient
==========================================================
`#include <array_ops.h>`
Compute gradients for a [FakeQuantWithMinMaxVarsPerChannel](fake-quant-with-min-max-vars-per-channel#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel) operation.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* gradients: Backpropagated gradients above the [FakeQuantWithMinMaxVars](fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation, shape one of: `[d]`, `[b, d]`, `[b, h, w, d]`.
* inputs: Values passed as inputs to the [FakeQuantWithMinMaxVars](fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation, shape same as `gradients`. min, max: Quantization interval, floats of shape `[d]`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)`):
* num\_bits: The bitwidth of the quantization; between 2 and 16, inclusive.
* narrow\_range: Whether to quantize into 2^num\_bits - 1 distinct values.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` backprops\_wrt\_input: Backpropagated gradients w.r.t. inputs, shape same as `inputs`: `gradients * (inputs >= min && inputs <= max)`.
* `[Output](../output#classtensorflow_1_1_output)` backprop\_wrt\_min: Backpropagated gradients w.r.t. min parameter, shape `[d]`: `sum_per_d(gradients * (inputs < min))`.
* `[Output](../output#classtensorflow_1_1_output)` backprop\_wrt\_max: Backpropagated gradients w.r.t. max parameter, shape `[d]`: `sum_per_d(gradients * (inputs > max))`.
| Constructors and Destructors |
| --- |
| `[FakeQuantWithMinMaxVarsPerChannelGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a7521d0f809a9a2bab753031ec59937a1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max)` |
| `[FakeQuantWithMinMaxVarsPerChannelGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1abf40f598a2e88d6f3a163fc6ac8c5a7d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max, const [FakeQuantWithMinMaxVarsPerChannelGradient::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[backprop\_wrt\_max](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1acc9bf06f7b09f2437e913f6f32f6dfe0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[backprop\_wrt\_min](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1ae7efb996b2e96e793a55decfaac3bfc4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[backprops\_wrt\_input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a99d7e4cadd3a7b374e246edb6cc207fe)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a2054be8cb0cdd3bc1c9721baa5cca289)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1a027f51a466b8dcf2dbff757b15dc7200)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1ad2357206b80cb845d85a727dcdd2d022)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient/attrs) | Optional attribute setters for [FakeQuantWithMinMaxVarsPerChannelGradient](fake-quant-with-min-max-vars-per-channel-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient). |
Public attributes
-----------------
### backprop\_wrt\_max
```
::tensorflow::Output backprop_wrt_max
```
### backprop\_wrt\_min
```
::tensorflow::Output backprop_wrt_min
```
### backprops\_wrt\_input
```
::tensorflow::Output backprops_wrt_input
```
### operation
```
Operation operation
```
Public functions
----------------
### FakeQuantWithMinMaxVarsPerChannelGradient
```
FakeQuantWithMinMaxVarsPerChannelGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input inputs,
::tensorflow::Input min,
::tensorflow::Input max
)
```
### FakeQuantWithMinMaxVarsPerChannelGradient
```
FakeQuantWithMinMaxVarsPerChannelGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input inputs,
::tensorflow::Input min,
::tensorflow::Input max,
const FakeQuantWithMinMaxVarsPerChannelGradient::Attrs & attrs
)
```
Public static functions
-----------------------
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Add tensorflow::ops::Add
====================
`#include <math_ops.h>`
Returns x + y element-wise.
Summary
-------
*NOTE*: `[Add](add#classtensorflow_1_1ops_1_1_add)` supports broadcasting. `[AddN](add-n#classtensorflow_1_1ops_1_1_add_n)` does not. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Given two input tensors, the `tf.add` operation computes the sum for every element in the tensor.
Both input and output have a range `(-inf, inf)`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Add](#classtensorflow_1_1ops_1_1_add_1a22a7ff05cc6f6e5c5323fc98a71521c4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_add_1a4fefd3ff7af9d37b374db299a36ddaee)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_add_1a85470018581f846e818de93be3cbbda9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_add_1a516d025bfd4e035ba7152a277319bdee)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_1a55fd96e0d14ff73d6aef1087952b6db2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_1a6873696b8a1abc00d654d99bc533697b)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Add
```
Add(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FusedBatchNormV2 tensorflow::ops::FusedBatchNormV2
=================================
`#include <nn_ops.h>`
Batch normalization.
Summary
-------
Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for input data.
* scale: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.
* offset: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for offset, to shift to the normalized x.
* mean: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for population mean. Used for inference only; must be empty for training.
* variance: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for population variance. Used for inference only; must be empty for training.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)`):
* epsilon: A small float number added to the variance of x.
* data\_format: The data format for x and y. Either "NHWC" (default) or "NCHW".
* is\_training: A bool value to indicate the operation is for training (default) or inference.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` y: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for output data.
* `[Output](../output#classtensorflow_1_1_output)` batch\_mean: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be used by TensorFlow to compute the running mean.
* `[Output](../output#classtensorflow_1_1_output)` batch\_variance: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance, to be used by TensorFlow to compute the running variance.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_1: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be reused in the gradient computation.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_2: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case), to be reused in the gradient computation.
| Constructors and Destructors |
| --- |
| `[FusedBatchNormV2](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a41b5d9943718ba17353eb0bea3660fb5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offset, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mean, ::[tensorflow::Input](../input#classtensorflow_1_1_input) variance)` |
| `[FusedBatchNormV2](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a22fcefed0156ba86e64e061602ec0502)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offset, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mean, ::[tensorflow::Input](../input#classtensorflow_1_1_input) variance, const [FusedBatchNormV2::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[batch\_mean](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1ad9498789c65ee5d72dd6402f5835b8b0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[batch\_variance](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1af3991b993b39913909e81cd81d31c9c8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a62346d231fb85e6491b13e4fc411ab46)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reserve\_space\_1](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1ab49ecd24ce13e304ef6ab0fab40d0db2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_2](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1ae91d40f4fb497e2879f0df7a2e9ee3b4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[y](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a5d32535fa6ebf586beef899f5fa9d9d1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a3067def97f7ccef0ca9214a5c3edcb65)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` |
| `[Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a23f682a773a88566f7b763b43f804830)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` |
| `[ExponentialAvgFactor](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a9def86742bd64060ab5f1f2878155759)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` |
| `[IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_v2_1a3f4305936738a332346a877a56f0efd3)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedBatchNormV2::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v2/attrs) | Optional attribute setters for [FusedBatchNormV2](fused-batch-norm-v2#classtensorflow_1_1ops_1_1_fused_batch_norm_v2). |
Public attributes
-----------------
### batch\_mean
```
::tensorflow::Output batch_mean
```
### batch\_variance
```
::tensorflow::Output batch_variance
```
### operation
```
Operation operation
```
### reserve\_space\_1
```
::tensorflow::Output reserve_space_1
```
### reserve\_space\_2
```
::tensorflow::Output reserve_space_2
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### FusedBatchNormV2
```
FusedBatchNormV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input offset,
::tensorflow::Input mean,
::tensorflow::Input variance
)
```
### FusedBatchNormV2
```
FusedBatchNormV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input offset,
::tensorflow::Input mean,
::tensorflow::Input variance,
const FusedBatchNormV2::Attrs & attrs
)
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Epsilon
```
Attrs Epsilon(
float x
)
```
### ExponentialAvgFactor
```
Attrs ExponentialAvgFactor(
float x
)
```
### IsTraining
```
Attrs IsTraining(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyProximalGradientDescent tensorflow::ops::ResourceSparseApplyProximalGradientDescent
===========================================================
`#include <training_ops.h>`
Sparse update '\*var' as FOBOS algorithm with fixed learning rate.
Summary
-------
That is for rows we have grad for, we update var as follows: prox\_v = var - alpha \* grad var = sign(prox\_v)/(1+alpha\*l2) \* max{|prox\_v|-alpha\*l1,0}
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* alpha: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs)`):
* use\_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1a045bee13c19911e4f7a40bfe1366c6e1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[ResourceSparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1afac4191272f3b8d9d42cf0adb1b5427b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [ResourceSparseApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1a378316d23cd77b905128227192e3b10c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1ad6ed2bcb828502eb8831b972afe172f3)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1a9dcb62b192d34bba83cb6cfc7026ee55)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs) | Optional attribute setters for [ResourceSparseApplyProximalGradientDescent](resource-sparse-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyProximalGradientDescent
```
ResourceSparseApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### ResourceSparseApplyProximalGradientDescent
```
ResourceSparseApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices,
const ResourceSparseApplyProximalGradientDescent::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Conv2DBackpropInput tensorflow::ops::Conv2DBackpropInput
====================================
`#include <nn_ops.h>`
Computes the gradients of convolution with respect to the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_sizes: An integer vector representing the shape of `input`, where `input` is a 4-D `[batch, height, width, channels]` tensor.
* filter: 4-D with shape `[filter_height, filter_width, in_channels, out_channels]`.
* out\_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`. Gradients w.r.t. the output of the convolution.
* strides: The stride of the sliding window for each dimension of the input of the convolution. Must be in the same order as the dimension specified with format.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)`):
* explicit\_paddings: If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width].
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient w.r.t. the input of the convolution.
| Constructors and Destructors |
| --- |
| `[Conv2DBackpropInput](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1aa5357992b64dbb43b51d35c084d442d8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[Conv2DBackpropInput](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a01da97aaaf681a4f6f45d3bda57f0f82)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding, const [Conv2DBackpropInput::Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1aebb0f66b81bb602fa8600e2e32f621b2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a53bf3bf2eb2af62764981f62c794fbe2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1acf62af3e404315cfe9622e3d1295033b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a94315c7d6148fb6451deb58f91955405)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a1bced60701935dddacef1af9398879df)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1ac762988224740afda86e2a852ef11774)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a01b3b905a6bba3d7c7e61238d45109e4)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a4f19fe8f8ae4c3b237038489ba58a721)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` |
| `[UseCudnnOnGpu](#classtensorflow_1_1ops_1_1_conv2_d_backprop_input_1a6df425d872077ec66d9eb2e2b42f767b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Conv2DBackpropInput::Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-input/attrs) | Optional attribute setters for [Conv2DBackpropInput](conv2-d-backprop-input#classtensorflow_1_1ops_1_1_conv2_d_backprop_input). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conv2DBackpropInput
```
Conv2DBackpropInput(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_sizes,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### Conv2DBackpropInput
```
Conv2DBackpropInput(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_sizes,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const Conv2DBackpropInput::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
### UseCudnnOnGpu
```
Attrs UseCudnnOnGpu(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseBincount tensorflow::ops::SparseBincount
===============================
`#include <math_ops.h>`
Counts the number of occurrences of each value in an integer array.
Summary
-------
Outputs a vector with length `size` and the same dtype as `weights`. If `weights` are empty, then index `i` stores the number of times the value `i` is counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of the value in `weights` at each index where the corresponding value in `arr` is `i`.
Values in `arr` outside of the range [0, size) are ignored.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: 2D int64 `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* values: 1D int `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* dense\_shape: 1D int64 `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* size: non-negative int scalar `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* weights: is an int32, int64, float32, or float64 `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as `input`, or a length-0 `[Tensor](../tensor#classtensorflow_1_1_tensor)`, in which case it acts as all weights equal to 1.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-bincount/attrs#structtensorflow_1_1ops_1_1_sparse_bincount_1_1_attrs)`):
* binary\_output: bool; Whether the kernel should count the appearance or number of occurrences.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with length equal to `size` or 2D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with [batch\_size, `size`]. The counts or summed weights for each value in the range [0, size).
| Constructors and Destructors |
| --- |
| `[SparseBincount](#classtensorflow_1_1ops_1_1_sparse_bincount_1add3e650f345cdb1a958ae5b9c2b5910c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights)` |
| `[SparseBincount](#classtensorflow_1_1ops_1_1_sparse_bincount_1ac36e3c43ebeea45745ee7ad8a11f50bf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights, const [SparseBincount::Attrs](../../../struct/tensorflow/ops/sparse-bincount/attrs#structtensorflow_1_1ops_1_1_sparse_bincount_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_bincount_1a72a053de9ddef8e41a3ddbe6e09b3328)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_bincount_1aeda65e54197bec9991854470532c9e16)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_bincount_1abb67289c053d4330a2fbb4d321d76bbb)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_bincount_1a65f4edd888ad28f8f7c7b5dde59f60a3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_bincount_1a5eef65b2105788d75c037d616b8528d8)() const` | |
| Public static functions |
| --- |
| `[BinaryOutput](#classtensorflow_1_1ops_1_1_sparse_bincount_1a724a0efdba7dbfd4e37e5b09ee2b07c5)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-bincount/attrs#structtensorflow_1_1ops_1_1_sparse_bincount_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseBincount::Attrs](../../../struct/tensorflow/ops/sparse-bincount/attrs) | Optional attribute setters for [SparseBincount](sparse-bincount#classtensorflow_1_1ops_1_1_sparse_bincount). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseBincount
```
SparseBincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
::tensorflow::Input values,
::tensorflow::Input dense_shape,
::tensorflow::Input size,
::tensorflow::Input weights
)
```
### SparseBincount
```
SparseBincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
::tensorflow::Input values,
::tensorflow::Input dense_shape,
::tensorflow::Input size,
::tensorflow::Input weights,
const SparseBincount::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### BinaryOutput
```
Attrs BinaryOutput(
bool x
)
```
tensorflow_cpp tensorflow::ops::RestoreSlice tensorflow::ops::RestoreSlice
=============================
`#include <io_ops.h>`
Restores a tensor from checkpoint files.
Summary
-------
This is like `[Restore](restore#classtensorflow_1_1ops_1_1_restore)` except that restored tensor can be listed as filling only a slice of a larger tensor. `shape_and_slice` specifies the shape of the larger tensor and the slice that the restored tensor covers.
The `shape_and_slice` input has the same format as the elements of the `shapes_and_slices` input of the `[SaveSlices](save-slices#classtensorflow_1_1ops_1_1_save_slices)` op.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* file\_pattern: Must have a single element. The pattern of the files from which we read the tensor.
* tensor\_name: Must have a single element. The name of the tensor to be restored.
* shape\_and\_slice: Scalar. The shapes and slice specifications to use when restoring a tensors.
* dt: The type of the tensor to be restored.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/restore-slice/attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs)`):
* preferred\_shard: Index of file to open first if multiple files match `file_pattern`. See the documentation for `[Restore](restore#classtensorflow_1_1ops_1_1_restore)`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The restored tensor.
| Constructors and Destructors |
| --- |
| `[RestoreSlice](#classtensorflow_1_1ops_1_1_restore_slice_1a2d2ed9358de458c5ac241a0b49dd0389)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) file_pattern, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_name, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape_and_slice, DataType dt)` |
| `[RestoreSlice](#classtensorflow_1_1ops_1_1_restore_slice_1a901a12a32fed966841204972e978f1e2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) file_pattern, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_name, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape_and_slice, DataType dt, const [RestoreSlice::Attrs](../../../struct/tensorflow/ops/restore-slice/attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_restore_slice_1a2e52156c6ad72a0c59d36634c5a00fc2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[tensor](#classtensorflow_1_1ops_1_1_restore_slice_1a4edd358a8874c36fb6833d1ede49ea5b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_restore_slice_1a8fd0b9d2345f9764bce4bf60b909df4e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_restore_slice_1a5b9012c2e1217bc1dee69a95451e7897)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_restore_slice_1aa5b92a74357789547971721a0725640b)() const` | |
| Public static functions |
| --- |
| `[PreferredShard](#classtensorflow_1_1ops_1_1_restore_slice_1ab8d2e2b14f8caab4f86d94957df53eef)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/restore-slice/attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RestoreSlice::Attrs](../../../struct/tensorflow/ops/restore-slice/attrs) | Optional attribute setters for [RestoreSlice](restore-slice#classtensorflow_1_1ops_1_1_restore_slice). |
Public attributes
-----------------
### operation
```
Operation operation
```
### tensor
```
::tensorflow::Output tensor
```
Public functions
----------------
### RestoreSlice
```
RestoreSlice(
const ::tensorflow::Scope & scope,
::tensorflow::Input file_pattern,
::tensorflow::Input tensor_name,
::tensorflow::Input shape_and_slice,
DataType dt
)
```
### RestoreSlice
```
RestoreSlice(
const ::tensorflow::Scope & scope,
::tensorflow::Input file_pattern,
::tensorflow::Input tensor_name,
::tensorflow::Input shape_and_slice,
DataType dt,
const RestoreSlice::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### PreferredShard
```
Attrs PreferredShard(
int64 x
)
```
tensorflow_cpp tensorflow::ops::QueueEnqueueMany tensorflow::ops::QueueEnqueueMany
=================================
`#include <data_flow_ops.h>`
Enqueues zero or more tuples of one or more tensors in the given queue.
Summary
-------
This operation slices each component tensor along the 0th dimension to make multiple queue elements. [All](all#classtensorflow_1_1ops_1_1_all) of the tuple components must have the same size in the 0th dimension.
The components input has k elements, which correspond to the components of tuples stored in the given queue.
N.B. If the queue is full, this operation will block until the given elements have been enqueued (or 'timeout\_ms' elapses, if specified).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
* components: One or more tensors from which the enqueued tensors should be taken.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/queue-enqueue-many/attrs#structtensorflow_1_1ops_1_1_queue_enqueue_many_1_1_attrs)`):
* timeout\_ms: If the queue is too full, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[QueueEnqueueMany](#classtensorflow_1_1ops_1_1_queue_enqueue_many_1a5ecdf3e3a6258d96aead53f0a7dd978d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) components)` |
| `[QueueEnqueueMany](#classtensorflow_1_1ops_1_1_queue_enqueue_many_1afefa06b2fa7cccfdcadef27efed52358)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) components, const [QueueEnqueueMany::Attrs](../../../struct/tensorflow/ops/queue-enqueue-many/attrs#structtensorflow_1_1ops_1_1_queue_enqueue_many_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_queue_enqueue_many_1a446ef8eb2cfb77152f2bdb7478c31824)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_queue_enqueue_many_1a884681259cd800fb78503ea825852430)() const` | |
| Public static functions |
| --- |
| `[TimeoutMs](#classtensorflow_1_1ops_1_1_queue_enqueue_many_1ae1ceaf22a97e82b627c27817a388c723)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/queue-enqueue-many/attrs#structtensorflow_1_1ops_1_1_queue_enqueue_many_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QueueEnqueueMany::Attrs](../../../struct/tensorflow/ops/queue-enqueue-many/attrs) | Optional attribute setters for [QueueEnqueueMany](queue-enqueue-many#classtensorflow_1_1ops_1_1_queue_enqueue_many). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### QueueEnqueueMany
```
QueueEnqueueMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::InputList components
)
```
### QueueEnqueueMany
```
QueueEnqueueMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::InputList components,
const QueueEnqueueMany::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### TimeoutMs
```
Attrs TimeoutMs(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ResourceScatterNdSub tensorflow::ops::ResourceScatterNdSub
=====================================
`#include <state_ops.h>`
Applies sparse subtraction to individual values or slices in a [Variable](variable#classtensorflow_1_1ops_1_1_variable).
Summary
-------
`ref` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with rank `P` and `indices` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of `indices` (with length `K`) corresponds to indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th dimension of `ref`.
`updates` is `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q-1+P-K` with shape:
```
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
```
For example, say we want to subtract 4 scattered elements from a rank-1 tensor with 8 elements. In Python, that subtraction would look like this:
```
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
sub = tf.scatter_nd_sub(ref, indices, updates)
with tf.Session() as sess:
print sess.run(sub)
```
The resulting update to ref would look like this:
```
[1, -9, 3, -6, -4, 6, 7, -4]
```
See `tf.scatter_nd` for more details about how to make updates to slices.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A resource handle. Must be from a VarHandleOp.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of values to add to ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-sub/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceScatterNdSub](#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1a25e5c067a5d697fef98c041f96651e44)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ResourceScatterNdSub](#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1a24f475452b33af301e07cf9d813549ec)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ResourceScatterNdSub::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-sub/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1a63fdcb76d053d0965e87b95192e7dcbb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1aa2d4f9b23d89ee2fef6c5d15417e75ae)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1a91aca593a855009a4e43ecb827f8e410)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-sub/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceScatterNdSub::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-sub/attrs) | Optional attribute setters for [ResourceScatterNdSub](resource-scatter-nd-sub#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceScatterNdSub
```
ResourceScatterNdSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ResourceScatterNdSub
```
ResourceScatterNdSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ResourceScatterNdSub::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::HSVToRGB tensorflow::ops::HSVToRGB
=========================
`#include <image_ops.h>`
Convert one or more images from HSV to RGB.
Summary
-------
Outputs a tensor of the same shape as the `images` tensor, containing the RGB value of the pixels. The output is only well defined if the value in `images` are in `[0,1]`.
See `rgb_to_hsv` for a description of the HSV encoding.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 1-D or higher rank. HSV data to convert. Last dimension must be size 3.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: `images` converted to RGB.
| Constructors and Destructors |
| --- |
| `[HSVToRGB](#classtensorflow_1_1ops_1_1_h_s_v_to_r_g_b_1a1409722c4dd53811c226fbb1f813bd66)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_h_s_v_to_r_g_b_1a5078b98877259cf977691d74045a8ce9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_h_s_v_to_r_g_b_1a64224dbb99ba5a7093433f3ba94c224e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_h_s_v_to_r_g_b_1ab34a36f7af9018c8c2e2c7a372d6ad8c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_h_s_v_to_r_g_b_1ada9be1d7e70b99306d4199283d565058)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_h_s_v_to_r_g_b_1a710f7313104d651aa5945500ccdc9274)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### HSVToRGB
```
HSVToRGB(
const ::tensorflow::Scope & scope,
::tensorflow::Input images
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResourceSparseApplyProximalAdagrad tensorflow::ops::ResourceSparseApplyProximalAdagrad
===================================================
`#include <training_ops.h>`
Sparse update entries in '\*var' and '\*accum' according to FOBOS algorithm.
Summary
-------
That is for rows we have grad for, we update var and accum as follows: accum += grad \* grad prox\_v = var prox\_v -= lr \* grad \* (1 / sqrt(accum)) var = sign(prox\_v)/(1+lr\*l2) \* max{|prox\_v|-lr\*l1,0}
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1a9ba5d6012d22eb8cef96aa1430a716d8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[ResourceSparseApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1a2ce03ebf9da64e7d774f3b6db1daca06)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [ResourceSparseApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1a595536a098c870a8f2829e5f66acd14f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1a40cb4f8b3990e91994267556ab98bc6a)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1ad945842d2b66c8aaabe2cf9d84418874)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-proximal-adagrad/attrs) | Optional attribute setters for [ResourceSparseApplyProximalAdagrad](resource-sparse-apply-proximal-adagrad#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyProximalAdagrad
```
ResourceSparseApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### ResourceSparseApplyProximalAdagrad
```
ResourceSparseApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices,
const ResourceSparseApplyProximalAdagrad::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Igammac tensorflow::ops::Igammac
========================
`#include <math_ops.h>`
Compute the upper regularized incomplete Gamma function `Q(a, x)`.
Summary
-------
The upper regularized incomplete Gamma function is defined as:
\(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\)
where
\(Gamma(a, x) = \int\_{x}^{\infty} t^{a-1} exp(-t) dt\)
is the upper incomplete Gamma function.
Note, above `P(a, x)` (`[Igamma](igamma#classtensorflow_1_1ops_1_1_igamma)`) is the lower regularized complete Gamma function.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Igammac](#classtensorflow_1_1ops_1_1_igammac_1a867ff7332904e014a469ad6b53e02243)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_igammac_1aa8a24d8a9d7920be5ac412c1e887da50)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_igammac_1aa4377078a3d027a75db11b2b85accf8f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_igammac_1a47a0b8542b7285a8a0041d1df02bf9be)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_igammac_1af16b9ff0899819a8d91c937f8e5846d3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_igammac_1ae10be53b838e3e96180c7c754fbb9e5e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Igammac
```
Igammac(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FusedPadConv2D tensorflow::ops::FusedPadConv2D
===============================
`#include <nn_ops.h>`
Performs a padding as a preprocess during a convolution.
Summary
-------
Similar to FusedResizeAndPadConv2d, this op allows for an optimized implementation where the spatial padding transformation stage is fused with the im2col lookup, but in this case without the bilinear filtering required for resizing. Fusing the padding prevents the need to write out the intermediate results as whole tensors, reducing memory pressure, and we can get some latency gains by merging the transformation calculations. The data\_format attribute for [Conv2D](conv2-d#classtensorflow_1_1ops_1_1_conv2_d) isn't supported by this op, and 'NHWC' order is used instead. Internally this op uses a single per-graph scratch buffer, which means that it will block if multiple versions are being run in parallel. This is because this operator is primarily an optimization to minimize memory usage.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, in_height, in_width, in_channels]`.
* paddings: A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of `input`.
* filter: 4-D with shape `[filter_height, filter_width, in_channels, out_channels]`.
* strides: 1-D of length 4. The stride of the sliding window for each dimension of `input`. Must be in the same order as the dimension specified with format.
* padding: The type of padding algorithm to use.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[FusedPadConv2D](#classtensorflow_1_1ops_1_1_fused_pad_conv2_d_1a29433f179ebfe80f5713baf602db0fb2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) paddings, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, StringPiece mode, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_fused_pad_conv2_d_1a74eadb05eed0b4ac42f88868b346c2c9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_fused_pad_conv2_d_1a9b745852fc93e6ac7cad86ed8d30355d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fused_pad_conv2_d_1a834a7fdc26dccf20c023a8a8f52aa70c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fused_pad_conv2_d_1a041ca6414035fd6c7c4526905e111b55)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fused_pad_conv2_d_1ab21cc1c1b746da897e2ee793cb9320a4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### FusedPadConv2D
```
FusedPadConv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input paddings,
::tensorflow::Input filter,
StringPiece mode,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::BiasAddGrad tensorflow::ops::BiasAddGrad
============================
`#include <nn_ops.h>`
The backward operation for "BiasAdd" on the "bias" tensor.
Summary
-------
It accumulates all the values from out\_backprop into the feature dimension. For NHWC data format, the feature dimension is the last. For NCHW data format, the feature dimension is the third-to-last.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* out\_backprop: [Any](any#classtensorflow_1_1ops_1_1_any) number of dimensions.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/bias-add-grad/attrs#structtensorflow_1_1ops_1_1_bias_add_grad_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the bias tensor will be added to the last dimension of the value tensor. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. The tensor will be added to "in\_channels", the third-to-the-last dimension.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D with size the feature dimension of `out_backprop`.
| Constructors and Destructors |
| --- |
| `[BiasAddGrad](#classtensorflow_1_1ops_1_1_bias_add_grad_1a0b471227bda69729c6aef3eedee7ce76)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop)` |
| `[BiasAddGrad](#classtensorflow_1_1ops_1_1_bias_add_grad_1a7ed7a556f0defe36d84e76b4e1d82520)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const [BiasAddGrad::Attrs](../../../struct/tensorflow/ops/bias-add-grad/attrs#structtensorflow_1_1ops_1_1_bias_add_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_bias_add_grad_1aac9a30fd0d04953d33bfab584e16129e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_bias_add_grad_1ad08acfbdc2d0884b697b7a5bbc697ae8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_bias_add_grad_1aeccff457f3c53d6baabeb9c55f6652f2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bias_add_grad_1a5bad18eefc1b7c3abb7e355a2ac9f7e8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bias_add_grad_1a2599155ff799c242f1114fe34acc6280)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_bias_add_grad_1a2d3136a07563909023605499a1fd4600)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/bias-add-grad/attrs#structtensorflow_1_1ops_1_1_bias_add_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BiasAddGrad::Attrs](../../../struct/tensorflow/ops/bias-add-grad/attrs) | Optional attribute setters for [BiasAddGrad](bias-add-grad#classtensorflow_1_1ops_1_1_bias_add_grad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BiasAddGrad
```
BiasAddGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input out_backprop
)
```
### BiasAddGrad
```
BiasAddGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input out_backprop,
const BiasAddGrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResizeNearestNeighbor tensorflow::ops::ResizeNearestNeighbor
======================================
`#include <image_ops.h>`
Resize `images` to `size` using nearest neighbor interpolation.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 4-D with shape `[batch, height, width, channels]`.
* size: = A 1-D int32 [Tensor](../tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resize-nearest-neighbor/attrs#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs)`):
* align\_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, new_height, new_width, channels]`.
| Constructors and Destructors |
| --- |
| `[ResizeNearestNeighbor](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a761fcaa879c10aefeec7d336c1695dbe)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size)` |
| `[ResizeNearestNeighbor](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1ae32cb1a2efb9fc7d9ecd04c33c95396a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, const [ResizeNearestNeighbor::Attrs](../../../struct/tensorflow/ops/resize-nearest-neighbor/attrs#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1afbdcb2a978bc8cddb8a0ae142c6122b7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[resized\_images](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a712b5521f03955dd2c8dd9d4fc80a8e9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a32fd059ad2b707aeac9c69cdaeb7a41f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a1c15b7ce69776c76fa911ed327e4ebe6)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a3e913e24e4a326f695d0e58f1c759676)() const` | |
| Public static functions |
| --- |
| `[AlignCorners](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a48ad406e3999c115dcf8e8260c3861da)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-nearest-neighbor/attrs#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs)` |
| `[HalfPixelCenters](#classtensorflow_1_1ops_1_1_resize_nearest_neighbor_1a740fbf067e627cfad4d5d8eb1b17583a)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-nearest-neighbor/attrs#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResizeNearestNeighbor::Attrs](../../../struct/tensorflow/ops/resize-nearest-neighbor/attrs) | Optional attribute setters for [ResizeNearestNeighbor](resize-nearest-neighbor#classtensorflow_1_1ops_1_1_resize_nearest_neighbor). |
Public attributes
-----------------
### operation
```
Operation operation
```
### resized\_images
```
::tensorflow::Output resized_images
```
Public functions
----------------
### ResizeNearestNeighbor
```
ResizeNearestNeighbor(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size
)
```
### ResizeNearestNeighbor
```
ResizeNearestNeighbor(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
const ResizeNearestNeighbor::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AlignCorners
```
Attrs AlignCorners(
bool x
)
```
### HalfPixelCenters
```
Attrs HalfPixelCenters(
bool x
)
```
tensorflow_cpp tensorflow::ops::Where tensorflow::ops::Where
======================
`#include <array_ops.h>`
Reshapes a quantized tensor as per the Reshape op.
Summary
-------
```
Args:
* scope: A Scope object
* shape: Defines the shape of the output tensor.
* input_min: The minimum value of the input.
* input_max: The maximum value of the input.
```
```
Returns:
* `Output` output
* `Output` output_min: This value is copied from input_min.
* `Output` output_max: This value is copied from input_max. */
class QuantizedReshape {
public:
QuantizedReshape(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input shape, tensorflow::Input input_min,
tensorflow::Input input_max);
```
```
Operation operation;
tensorflow::Output output;
tensorflow::Output output_min;
tensorflow::Output output_max;
};
```
```
/** Returns the rank of a tensor.
```
```
This operation returns an integer representing the rank of `input`.
```
```
For example:
```
't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
=======================================================
shape of tensor 't' is [2, 2, 3]
================================
rank(t) ==> 3
```
**Note**: The rank of a tensor is not the same as the rank of a matrix. The rank
of a tensor is the number of indices required to uniquely select each element
of the tensor. Rank is also known as "order", "degree", or "ndims."
```
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The output tensor. */
class Rank {
public:
Rank(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Reshapes a tensor.
```
```
Given `tensor`, this operation returns a tensor that has the same values
as `tensor` with shape `shape`.
```
```
If one component of 1-D tensor `shape` is the special value -1, the size of that
dimension is computed so that the total size remains constant. In particular, a
`shape` of `[-1]` flattens into 1-D. At most one component of `shape` may be
unknown.
```
```
The `shape` must be 1-D and the operation returns a tensor with shape
`shape` filled with the values of `tensor`. In this case, the number of elements
implied by `shape` must be the same as the number of elements in `tensor`.
```
```
It is an error if `shape` is not 1-D.
```
```
For example:
```
tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]
=========================================
tensor 't' has shape [9]
========================
reshape(t, [3, 3]) ==> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
tensor 't' is [[[1, 1], [2, 2]],
================================
[[3, 3], [4, 4]]]
=================
tensor 't' has shape [2, 2, 2]
==============================
reshape(t, [2, 4]) ==> [[1, 1, 2, 2], [3, 3, 4, 4]]
tensor 't' is [[[1, 1, 1],
==========================
[2, 2, 2]],
===========
[[3, 3, 3],
===========
[4, 4, 4]],
===========
[[5, 5, 5],
===========
[6, 6, 6]]]
===========
tensor 't' has shape [3, 2, 3]
==============================
pass '[-1]' to flatten 't'
==========================
reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
-1 can also be used to infer the shape
======================================
-1 is inferred to be 9:
=======================
reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3], [4, 4, 4, 5, 5, 5, 6, 6, 6]]
-1 is inferred to be 2:
=======================
reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3], [4, 4, 4, 5, 5, 5, 6, 6, 6]]
-1 is inferred to be 3:
=======================
reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1], [2, 2, 2], [3, 3, 3]], [[4, 4, 4], [5, 5, 5], [6, 6, 6]]]
tensor 't' is [7]
=================
shape `[]` reshapes to a scalar
===============================
reshape(t, []) ==> 7
```
Args:
* scope: A Scope object
* shape: Defines the shape of the output tensor.
```
```
Returns:
* `Output`: The output tensor. */
class Reshape {
public:
Reshape(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input shape);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Assign `value` to the sliced l-value reference of `ref`.
```
```
The values of `value` are assigned to the positions in the variable
`ref` that are selected by the slice parameters. The slice parameters
`begin, `end`, `strides`, etc. work exactly as in `StridedSlice`.
```
```
NOTE this op currently does not support broadcasting and so `value`'s
shape must be exactly the shape produced by the slice of `ref`.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* the created `Operation` */
class ResourceStridedSliceAssign {
public:
/// Optional attribute setters for ResourceStridedSliceAssign
struct Attrs {
/// Defaults to 0
TF_MUST_USE_RESULT Attrs BeginMask(int64 x) {
Attrs ret = *this;
ret.begin_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EndMask(int64 x) {
Attrs ret = *this;
ret.end_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EllipsisMask(int64 x) {
Attrs ret = *this;
ret.ellipsis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs NewAxisMask(int64 x) {
Attrs ret = *this;
ret.new_axis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs ShrinkAxisMask(int64 x) {
Attrs ret = *this;
ret.shrink_axis_mask_ = x;
return ret;
}
```
```
int64 begin_mask_ = 0;
int64 end_mask_ = 0;
int64 ellipsis_mask_ = 0;
int64 new_axis_mask_ = 0;
int64 shrink_axis_mask_ = 0;
};
ResourceStridedSliceAssign(const tensorflow::Scope& scope,
tensorflow::Input ref, tensorflow::Input begin,
tensorflow::Input end, tensorflow::Input
strides, tensorflow::Input value);
ResourceStridedSliceAssign(const tensorflow::Scope& scope,
tensorflow::Input ref, tensorflow::Input begin,
tensorflow::Input end, tensorflow::Input
strides, tensorflow::Input value, const
ResourceStridedSliceAssign::Attrs& attrs);
operator ::tensorflow::Operation() const { return operation; }
```
```
static Attrs BeginMask(int64 x) {
return Attrs().BeginMask(x);
}
static Attrs EndMask(int64 x) {
return Attrs().EndMask(x);
}
static Attrs EllipsisMask(int64 x) {
return Attrs().EllipsisMask(x);
}
static Attrs NewAxisMask(int64 x) {
return Attrs().NewAxisMask(x);
}
static Attrs ShrinkAxisMask(int64 x) {
return Attrs().ShrinkAxisMask(x);
}
```
```
Operation operation;
};
```
```
/** Reverses variable length slices.
```
```
This op first slices `input` along the dimension `batch_dim`, and for each
slice `i`, reverses the first `seq_lengths[i]` elements along
the dimension `seq_dim`.
```
```
The elements of `seq_lengths` must obey `seq_lengths[i] <= input.dims[seq_dim]`,
and `seq_lengths` must be a vector of length `input.dims[batch_dim]`.
```
```
The output slice `i` along dimension `batch_dim` is then given by input
slice `i`, with the first `seq_lengths[i]` slices along dimension
`seq_dim` reversed.
```
```
For example:
```
Given this:
===========
batch\_dim = 0 seq\_dim = 1 input.dims = (4, 8, ...) seq\_lengths = [7, 2, 3, 5]
then slices of input are reversed on seq\_dim, but only up to seq\_lengths:
===========================================================================
output[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...] output[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...] output[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...] output[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...]
while entries past seq\_lens are copied through:
================================================
output[0, 7:, :, ...] = input[0, 7:, :, ...] output[1, 2:, :, ...] = input[1, 2:, :, ...] output[2, 3:, :, ...] = input[2, 3:, :, ...] output[3, 2:, :, ...] = input[3, 2:, :, ...]
```
In contrast, if:
```
Given this:
===========
batch\_dim = 2 seq\_dim = 0 input.dims = (8, ?, 4, ...) seq\_lengths = [7, 2, 3, 5]
then slices of input are reversed on seq\_dim, but only up to seq\_lengths:
===========================================================================
output[0:7, :, 0, :, ...] = input[7:0:-1, :, 0, :, ...] output[0:2, :, 1, :, ...] = input[2:0:-1, :, 1, :, ...] output[0:3, :, 2, :, ...] = input[3:0:-1, :, 2, :, ...] output[0:5, :, 3, :, ...] = input[5:0:-1, :, 3, :, ...]
while entries past seq\_lens are copied through:
================================================
output[7:, :, 0, :, ...] = input[7:, :, 0, :, ...] output[2:, :, 1, :, ...] = input[2:, :, 1, :, ...] output[3:, :, 2, :, ...] = input[3:, :, 2, :, ...] output[2:, :, 3, :, ...] = input[2:, :, 3, :, ...]
```
Args:
* scope: A Scope object
* input: The input to reverse.
* seq_lengths: 1-D with length `input.dims(batch_dim)` and
`max(seq_lengths) <= input.dims(seq_dim)`
* seq_dim: The dimension which is partially reversed.
```
```
Optional attributes (see `Attrs`):
* batch_dim: The dimension along which reversal is performed.
```
```
Returns:
* `Output`: The partially reversed input. It has the same shape as `input`. */
class ReverseSequence {
public:
/// Optional attribute setters for ReverseSequence
struct Attrs {
/** The dimension along which reversal is performed.
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs BatchDim(int64 x) {
Attrs ret = *this;
ret.batch_dim_ = x;
return ret;
}
```
```
int64 batch_dim_ = 0;
};
ReverseSequence(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input seq_lengths, int64 seq_dim);
ReverseSequence(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input seq_lengths, int64 seq_dim, const
ReverseSequence::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs BatchDim(int64 x) {
return Attrs().BatchDim(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Reverses specific dimensions of a tensor.
```
```
Given a `tensor`, and a `int32` tensor `axis` representing the set of
dimensions of `tensor` to reverse. This operation reverses each dimension
`i` for which there exists `j` s.t. `axis[j] == i`.
```
```
`tensor` can have up to 8 dimensions. The number of dimensions specified
in `axis` may be 0 or more entries. If an index is specified more than
once, a InvalidArgument error is raised.
```
```
For example:
```
tensor 't' is [[[[ 0, 1, 2, 3],
===============================
[ 4, 5, 6, 7],
==============
[ 8, 9, 10, 11]],
=================
[[12, 13, 14, 15],
==================
[16, 17, 18, 19],
=================
[20, 21, 22, 23]]]]
===================
tensor 't' shape is [1, 2, 3, 4]
================================
'dims' is [3] or 'dims' is [-1]
===============================
reverse(t, dims) ==> [[[[ 3, 2, 1, 0], [ 7, 6, 5, 4], [ 11, 10, 9, 8]], [[15, 14, 13, 12], [19, 18, 17, 16], [23, 22, 21, 20]]]]
'dims' is '[1]' (or 'dims' is '[-3]')
=====================================
reverse(t, dims) ==> [[[[12, 13, 14, 15], [16, 17, 18, 19], [20, 21, 22, 23] [[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]]]
'dims' is '[2]' (or 'dims' is '[-2]')
=====================================
reverse(t, dims) ==> [[[[8, 9, 10, 11], [4, 5, 6, 7], [0, 1, 2, 3]] [[20, 21, 22, 23], [16, 17, 18, 19], [12, 13, 14, 15]]]]
```
Args:
* scope: A Scope object
* tensor: Up to 8-D.
* axis: 1-D. The indices of the dimensions to reverse. Must be in the range
`[-rank(tensor), rank(tensor))`.
```
```
Returns:
* `Output`: The same shape as `tensor`. */
class Reverse {
public:
Reverse(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input axis);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Scatters `updates` into a tensor of shape `shape` according to `indices`.
```
```
Update the input tensor by scattering sparse `updates` according to individual values at the specified `indices`.
This op returns an `output` tensor with the `shape` you specify. This op is the
inverse of the tf.gather_nd operator which extracts values or slices from a
given tensor.
```
```
This operation is similar to tf.tensor_scatter_nd_add, except that the tensor
is zero-initialized. Calling tf.scatter_nd(indices, values, shape)
is identical to calling
`tf.tensor_scatter_nd_add(tf.zeros(shape, values.dtype), indices, values)`
```
```
If `indices` contains duplicates, the duplicate `values` are accumulated
(summed).
```
```
**WARNING**: The order in which updates are applied is nondeterministic, so the
output will be nondeterministic if `indices` contains duplicates;
numbers summed in different order may yield different results because of some
numerical approximation issues.
```
```
`indices` is an integer tensor of shape `shape`. The last dimension
of `indices` can be at most the rank of `shape`:
```
```
indices.shape[-1] <= shape.rank
```
```
The last dimension of `indices` corresponds to indices of elements
(if `indices.shape[-1] = shape.rank`) or slices
(if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of
`shape`.
```
```
`updates` is a tensor with shape:
```
```
indices.shape[:-1] + shape[indices.shape[-1]:]
```
```
The simplest form of the scatter op is to insert individual elements in
a tensor by index. Consider an example where you want to insert 4 scattered
elements in a rank-1 tensor with 8 elements.
```
```
In Python, this scatter operation would look like this:
```
python indices = tf.constant([[4], [3], [1], [7]]) updates = tf.constant([9, 10, 11, 12]) shape = tf.constant([8]) scatter = tf.scatter\_nd(indices, updates, shape) print(scatter)
```
The resulting tensor would look like this:
```
```
[0, 11, 0, 10, 9, 0, 0, 12]
```
```
You can also insert entire slices of a higher rank tensor all at once. For
example, you can insert two slices in the first dimension of a rank-3 tensor
with two matrices of new values.
```
```
In Python, this scatter operation would look like this:
```
python indices = tf.constant([[0], [2]]) updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]], [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]) shape = tf.constant([4, 4, 4]) scatter = tf.scatter\_nd(indices, updates, shape) print(scatter)
```
The resulting tensor would look like this:
```
```
[[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]
```
```
Note that on CPU, if an out of bound index is found, an error is returned.
On GPU, if an out of bound index is found, the index is ignored.
```
```
Args:
* scope: A Scope object
* indices: Tensor of indices.
* updates: Values to scatter into the output tensor.
* shape: 1-D. The shape of the output tensor.
```
```
Returns:
* `Output`: A new tensor with the given shape and updates applied according
to the indices. */
class ScatterNd {
public:
ScatterNd(const tensorflow::Scope& scope, tensorflow::Input indices,
tensorflow::Input updates, tensorflow::Input shape);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Applies sparse addition to `input` using individual values or slices
```
```
from `updates` according to indices `indices`. The updates are non-aliasing:
`input` is only modified in-place if no other operations will use it.
Otherwise, a copy of `input` is made. This operation has a gradient with
respect to both `input` and `updates`.
```
```
`input` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.
```
```
`indices` must be integer tensor, containing indices into `input`.
It must be shape \([d_0, ..., d_{Q-2}, K]\) where `0 < K <= P`.
```
```
The innermost dimension of `indices` (with length `K`) corresponds to
indices into elements (if `K = P`) or `(P-K)`-dimensional slices
(if `K < P`) along the `K`th dimension of `input`.
```
```
`updates` is `Tensor` of rank `Q-1+P-K` with shape:
```
```
$$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$
```
```
For example, say we want to add 4 scattered elements to a rank-1 tensor to 8
elements. In Python, that addition would look like this:
```
```
input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8])
indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
output = tf.scatter_nd_non_aliasing_add(input, indices, updates)
with tf.Session() as sess:
print(sess.run(output))
```
```
The resulting value `output` would look like this:
```
```
[1, 13, 3, 14, 14, 6, 7, 20]
```
```
See tf.scatter_nd for more details about how to make updates to slices.
```
```
Args:
* scope: A Scope object
* input: A Tensor.
* indices: A Tensor. Must be one of the following types: `int32`, `int64`.
A tensor of indices into `input`.
* updates: A Tensor. Must have the same type as ref. A tensor of updated values
to add to `input`.
```
```
Returns:
* `Output`: A `Tensor` with the same shape as `input`, containing values of `input`
updated with `updates`. */
class ScatterNdNonAliasingAdd {
public:
ScatterNdNonAliasingAdd(const tensorflow::Scope& scope, tensorflow::Input
input, tensorflow::Input indices, tensorflow::Input
updates);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Returns the shape of a tensor.
```
```
This operation returns a 1-D integer tensor representing the shape of `input`.
```
```
For example:
```
't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
=======================================================
shape(t) ==> [2, 2, 3]
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The output tensor. */
class Shape {
public:
/// Optional attribute setters for Shape
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutType(DataType x) {
Attrs ret = *this;
ret.out_type_ = x;
return ret;
}
```
```
DataType out_type_ = DT_INT32;
};
Shape(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
Shape(const tensorflow::Scope& scope, tensorflow::Input input, const
Shape::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs OutType(DataType x) {
return Attrs().OutType(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Returns shape of tensors.
```
```
This operation returns N 1-D integer tensors representing shape of `input[i]s`.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* `OutputList`: The output tensor. */
class ShapeN {
public:
/// Optional attribute setters for ShapeN
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutType(DataType x) {
Attrs ret = *this;
ret.out_type_ = x;
return ret;
}
```
```
DataType out_type_ = DT_INT32;
};
ShapeN(const ::tensorflow::Scope& scope, ::tensorflow::InputList input);
ShapeN(const tensorflow::Scope& scope, tensorflow::InputList input, const
ShapeN::Attrs& attrs);
tensorflow::Output operator[](size_t index) const { return output[index]; }
```
```
static Attrs OutType(DataType x) {
return Attrs().OutType(x);
}
```
```
Operation operation;
::tensorflow::OutputList output;
};
```
```
/** Returns the size of a tensor.
```
```
This operation returns an integer representing the number of elements in
`input`.
```
```
For example:
```
't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
=========================================================
size(t) ==> 12
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The output tensor. */
class Size {
public:
/// Optional attribute setters for Size
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutType(DataType x) {
Attrs ret = *this;
ret.out_type_ = x;
return ret;
}
```
```
DataType out_type_ = DT_INT32;
};
Size(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
Size(const tensorflow::Scope& scope, tensorflow::Input input, const
Size::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs OutType(DataType x) {
return Attrs().OutType(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Return a slice from 'input'.
```
```
The output tensor is a tensor with dimensions described by 'size'
whose values are extracted from 'input' starting at the offsets in
'begin'.
```
```
*Requirements*:
0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n)
```
```
Args:
* scope: A Scope object
* begin: begin[i] specifies the offset into the 'i'th dimension of
'input' to slice from.
* size: size[i] specifies the number of elements of the 'i'th dimension
of 'input' to slice. If size[i] is -1, all remaining elements in dimension
i are included in the slice (i.e. this is equivalent to setting
size[i] = input.dim_size(i) - begin[i]).
```
```
Returns:
* `Output`: The output tensor. */
class Slice {
public:
Slice(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input begin, tensorflow::Input size);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Returns a copy of the input tensor.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The output tensor. */
class Snapshot {
public:
Snapshot(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** SpaceToBatch for 4-D tensors of type T.
```
```
This is a legacy version of the more general SpaceToBatchND.
```
```
Zero-pads and then rearranges (permutes) blocks of spatial data into batch.
More specifically, this op outputs a copy of the input tensor where values from
the `height` and `width` dimensions are moved to the `batch` dimension. After
the zero-padding, both `height` and `width` of the input must be divisible by the
block size.
```
```
The attr `block_size` must be greater than one. It indicates the block size.
```
```
* Non-overlapping blocks of size `block_size x block size` in the height and
width dimensions are rearranged into the batch dimension at each location.
* The batch of the output tensor is `batch * block_size * block_size`.
* Both height_pad and width_pad must be divisible by block_size.
```
```
The shape of the output will be:
```
```
[batch*block_size*block_size, height_pad/block_size, width_pad/block_size,
depth]
```
```
Some examples:
```
```
(1) For the following input of shape `[1, 2, 2, 1]` and block_size of 2:
```
x = [[[[1], [2]], [[3], [4]]]]
```
The output tensor has shape `[4, 1, 1, 1]` and value:
```
[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
```
(2) For the following input of shape `[1, 2, 2, 3]` and block_size of 2:
```
x = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]]
```
The output tensor has shape `[4, 1, 1, 3]` and value:
```
[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
```
(3) For the following input of shape `[1, 4, 4, 1]` and block_size of 2:
```
x = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], [[9], [10], [11], [12]], [[13], [14], [15], [16]]]]
```
The output tensor has shape `[4, 2, 2, 1]` and value:
```
x = [[[[1], [3]], [[9], [11]]], [[[2], [4]], [[10], [12]]], [[[5], [7]], [[13], [15]]], [[[6], [8]], [[14], [16]]]]
```
(4) For the following input of shape `[2, 2, 4, 1]` and block_size of 2:
```
x = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]]], [[[9], [10], [11], [12]], [[13], [14], [15], [16]]]]
```
The output tensor has shape `[8, 1, 2, 1]` and value:
```
x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]], [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
```
Among others, this operation is useful for reducing atrous convolution into
regular convolution.
```
```
Args:
* scope: A Scope object
* input: 4-D with shape `[batch, height, width, depth]`.
* paddings: 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies
the padding of the input with zeros across the spatial dimensions as follows:
```
```
paddings = [[pad_top, pad_bottom], [pad_left, pad_right]]
```
```
The effective spatial dimensions of the zero-padded input tensor will be:
```
```
height_pad = pad_top + height + pad_bottom
width_pad = pad_left + width + pad_right
```
```
Returns:
* `Output`: The output tensor. */
class SpaceToBatch {
public:
SpaceToBatch(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input paddings, int64 block_size);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** SpaceToBatch for N-D tensors of type T.
```
```
This operation divides "spatial" dimensions `[1, ..., M]` of the input into a
grid of blocks of shape `block_shape`, and interleaves these blocks with the
"batch" dimension (0) such that in the output, the spatial dimensions
`[1, ..., M]` correspond to the position within the grid, and the batch
dimension combines both the position within a spatial block and the original
batch position. Prior to division into blocks, the spatial dimensions of the
input are optionally zero padded according to `paddings`. See below for a
precise description.
```
```
This operation is equivalent to the following steps:
```
```
1. Zero-pad the start and end of dimensions `[1, ..., M]` of the
input according to `paddings` to produce `padded` of shape `padded_shape`.
```
```
2. Reshape `padded` to `reshaped_padded` of shape:
```
```
[batch] +
[padded_shape[1] / block_shape[0],
block_shape[0],
...,
padded_shape[M] / block_shape[M-1],
block_shape[M-1]] +
remaining_shape
```
```
3. Permute dimensions of `reshaped_padded` to produce
`permuted_reshaped_padded` of shape:
```
```
block_shape +
[batch] +
[padded_shape[1] / block_shape[0],
...,
padded_shape[M] / block_shape[M-1]] +
remaining_shape
```
```
4. Reshape `permuted_reshaped_padded` to flatten `block_shape` into the batch
dimension, producing an output tensor of shape:
```
```
[batch * prod(block_shape)] +
[padded_shape[1] / block_shape[0],
...,
padded_shape[M] / block_shape[M-1]] +
remaining_shape
```
```
Some examples:
```
```
(1) For the following input of shape `[1, 2, 2, 1]`, `block_shape = [2, 2]`, and
`paddings = [[0, 0], [0, 0]]`:
```
x = [[[[1], [2]], [[3], [4]]]]
```
The output tensor has shape `[4, 1, 1, 1]` and value:
```
[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
```
(2) For the following input of shape `[1, 2, 2, 3]`, `block_shape = [2, 2]`, and
`paddings = [[0, 0], [0, 0]]`:
```
x = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]]
```
The output tensor has shape `[4, 1, 1, 3]` and value:
```
[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
```
(3) For the following input of shape `[1, 4, 4, 1]`, `block_shape = [2, 2]`, and
`paddings = [[0, 0], [0, 0]]`:
```
x = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], [[9], [10], [11], [12]], [[13], [14], [15], [16]]]]
```
The output tensor has shape `[4, 2, 2, 1]` and value:
```
x = [[[[1], [3]], [[9], [11]]], [[[2], [4]], [[10], [12]]], [[[5], [7]], [[13], [15]]], [[[6], [8]], [[14], [16]]]]
```
(4) For the following input of shape `[2, 2, 4, 1]`, block_shape = `[2, 2]`, and
paddings = `[[0, 0], [2, 0]]`:
```
x = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]]], [[[9], [10], [11], [12]], [[13], [14], [15], [16]]]]
```
The output tensor has shape `[8, 1, 3, 1]` and value:
```
x = [[[[0], [1], [3]]], [[[0], [9], [11]]], [[[0], [2], [4]]], [[[0], [10], [12]]], [[[0], [5], [7]]], [[[0], [13], [15]]], [[[0], [6], [8]]], [[[0], [14], [16]]]]
```
Among others, this operation is useful for reducing atrous convolution into
regular convolution.
```
```
Args:
* scope: A Scope object
* input: N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`,
where spatial_shape has `M` dimensions.
* block_shape: 1-D with shape `[M]`, all values must be >= 1.
* paddings: 2-D with shape `[M, 2]`, all values must be >= 0.
`paddings[i] = [pad_start, pad_end]` specifies the padding for input dimension
`i + 1`, which corresponds to spatial dimension `i`. It is required that
`block_shape[i]` divides `input_shape[i + 1] + pad_start + pad_end`.
```
```
Returns:
* `Output`: The output tensor. */
class SpaceToBatchND {
public:
SpaceToBatchND(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input block_shape, tensorflow::Input paddings);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** SpaceToDepth for tensors of type T.
```
```
Rearranges blocks of spatial data, into depth. More specifically,
this op outputs a copy of the input tensor where values from the `height`
and `width` dimensions are moved to the `depth` dimension.
The attr `block_size` indicates the input block size.
```
```
* Non-overlapping blocks of size `block_size x block size` are rearranged
into depth at each location.
* The depth of the output tensor is `block_size * block_size * input_depth`.
* The Y, X coordinates within each block of the input become the high order
component of the output channel index.
* The input tensor's height and width must be divisible by block_size.
```
```
The `data_format` attr specifies the layout of the input and output tensors
with the following options:
"NHWC": `[ batch, height, width, channels ]`
"NCHW": `[ batch, channels, height, width ]`
"NCHW_VECT_C":
`qint8 [ batch, channels / 4, height, width, 4 ]`
```
```
It is useful to consider the operation as transforming a 6-D Tensor.
e.g. for data_format = NHWC,
Each element in the input tensor can be specified via 6 coordinates,
ordered by decreasing memory layout significance as:
n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates
within the output image, bX, bY means coordinates
within the input block, iC means input channels).
The output would be a transpose to the following layout:
n,oY,oX,bY,bX,iC
```
```
This operation is useful for resizing the activations between convolutions
(but keeping all data), e.g. instead of pooling. It is also useful for training
purely convolutional models.
```
```
For example, given an input of shape `[1, 2, 2, 1]`, data_format = "NHWC" and
block_size = 2:
```
x = [[[[1], [2]], [[3], [4]]]]
```
This operation will output a tensor of shape `[1, 1, 1, 4]`:
```
[[[[1, 2, 3, 4]]]]
```
Here, the input has a batch of 1 and each batch element has shape `[2, 2, 1]`,
the corresponding output will have a single element (i.e. width and height are
both 1) and will have a depth of 4 channels (1 * block_size * block_size).
The output element shape is `[1, 1, 4]`.
```
```
For an input tensor with larger depth, here of shape `[1, 2, 2, 3]`, e.g.
```
x = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]]
```
This operation, for block_size of 2, will return the following tensor of shape
`[1, 1, 1, 12]`
```
[[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
```
Similarly, for the following input of shape `[1 4 4 1]`, and a block size of 2:
```
x = [[[[1], [2], [5], [6]], [[3], [4], [7], [8]], [[9], [10], [13], [14]], [[11], [12], [15], [16]]]]
```
the operator will return the following tensor of shape `[1 2 2 4]`:
```
x = [[[[1, 2, 3, 4], [5, 6, 7, 8]], [[9, 10, 11, 12], [13, 14, 15, 16]]]]
```
Args:
* scope: A Scope object
* block_size: The size of the spatial block.
```
```
Returns:
* `Output`: The output tensor. */
class SpaceToDepth {
public:
/// Optional attribute setters for SpaceToDepth
struct Attrs {
/// Defaults to "NHWC"
TF_MUST_USE_RESULT Attrs DataFormat(StringPiece x) {
Attrs ret = *this;
ret.data_format_ = x;
return ret;
}
```
```
StringPiece data_format_ = "NHWC";
};
SpaceToDepth(const tensorflow::Scope& scope, tensorflow::Input input, int64
block_size);
SpaceToDepth(const tensorflow::Scope& scope, tensorflow::Input input, int64
block_size, const SpaceToDepth::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs DataFormat(StringPiece x) {
return Attrs().DataFormat(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Splits a tensor into `num_split` tensors along one dimension.
```
```
Args:
* scope: A Scope object
* axis: 0-D. The dimension along which to split. Must be in the range
`[-rank(value), rank(value))`.
* value: The tensor to split.
* num_split: The number of ways to split. Must evenly divide
`value.shape[split_dim]`.
```
```
Returns:
* `OutputList`: They are identically shaped tensors, whose shape matches that of `value`
except along `axis`, where their sizes are
`values.shape[split_dim] / num_split`. */
class Split {
public:
Split(const tensorflow::Scope& scope, tensorflow::Input axis,
tensorflow::Input value, int64 num_split);
tensorflow::Output operator[](size_t index) const { return output[index]; }
```
```
Operation operation;
::tensorflow::OutputList output;
};
```
```
/** Splits a tensor into `num_split` tensors along one dimension.
```
```
Args:
* scope: A Scope object
* value: The tensor to split.
* size_splits: list containing the sizes of each output tensor along the split
dimension. Must sum to the dimension of value along split_dim.
Can contain one -1 indicating that dimension is to be inferred.
* axis: 0-D. The dimension along which to split. Must be in the range
`[-rank(value), rank(value))`.
```
```
Returns:
* `OutputList`: Tensors whose shape matches that of `value`
except along `axis`, where their sizes are
`size_splits[i]`. */
class SplitV {
public:
SplitV(const tensorflow::Scope& scope, tensorflow::Input value,
tensorflow::Input size_splits, tensorflow::Input axis, int64
num_split);
tensorflow::Output operator[](size_t index) const { return output[index]; }
```
```
Operation operation;
::tensorflow::OutputList output;
};
```
```
/** Removes dimensions of size 1 from the shape of a tensor.
```
```
Given a tensor `input`, this operation returns a tensor of the same type with
all dimensions of size 1 removed. If you don't want to remove all size 1
dimensions, you can remove specific size 1 dimensions by specifying
`axis`.
```
```
For example:
```
't' is a tensor of shape [1, 2, 1, 3, 1, 1]
===========================================
shape(squeeze(t)) ==> [2, 3]
```
Or, to remove specific size 1 dimensions:
```
't' is a tensor of shape [1, 2, 1, 3, 1, 1]
===========================================
shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
```
Args:
* scope: A Scope object
* input: The `input` to squeeze.
```
```
Optional attributes (see `Attrs`):
* axis: If specified, only squeezes the dimensions listed. The dimension
index starts at 0. It is an error to squeeze a dimension that is not 1. Must
be in the range `[-rank(input), rank(input))`.
```
```
Returns:
* `Output`: Contains the same data as `input`, but has one or more dimensions of
size 1 removed. */
class Squeeze {
public:
/// Optional attribute setters for Squeeze
struct Attrs {
/** If specified, only squeezes the dimensions listed. The dimension
index starts at 0. It is an error to squeeze a dimension that is not 1. Must
be in the range `[-rank(input), rank(input))`.
```
```
Defaults to [] */
TF_MUST_USE_RESULT Attrs Axis(const gtl::ArraySlice& x) {
Attrs ret = *this;
ret.axis_ = x;
return ret;
}
```
```
gtl::ArraySlice axis_ = {};
};
Squeeze(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
Squeeze(const tensorflow::Scope& scope, tensorflow::Input input, const
Squeeze::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs Axis(const gtl::ArraySlice& x) {
return Attrs().Axis(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Stops gradient computation.
```
```
When executed in a graph, this op outputs its input tensor as-is.
```
```
When building ops to compute gradients, this op prevents the contribution of
its inputs to be taken into account. Normally, the gradient generator adds ops
to a graph to compute the derivatives of a specified 'loss' by recursively
finding out inputs that contributed to its computation. If you insert this op
in the graph it inputs are masked from the gradient generator. They are not
taken into account for computing gradients.
```
```
This is useful any time you want to compute a value with TensorFlow but need
to pretend that the value was a constant. For example, the softmax function
for a vector x can be written as
```
python def softmax(x): numerator = tf.exp(x) denominator = tf.reduce\_sum(numerator) return numerator / denominator
```
This however is susceptible to overflow if the values in x are large. An
alternative more stable way is to subtract the maximum of x from each of the
values.
```
python def stable\_softmax(x): z = x - tf.reduce\_max(x) numerator = tf.exp(z) denominator = tf.reduce\_sum(numerator) return numerator / denominator
```
However, when we backprop through the softmax to x, we dont want to backprop
through the tf.reduce_max(x) (if the max values are not unique then the
gradient could flow to the wrong input) calculation and treat that as a
constant. Therefore, we should write this out as
```
python def stable\_softmax(x): z = x - tf.stop\_gradient(tf.reduce\_max(x)) numerator = tf.exp(z) denominator = tf.reduce\_sum(numerator) return numerator / denominator
```
Some other examples include:
```
```
* The *EM* algorithm where the *M-step* should not involve backpropagation
through the output of the *E-step*.
* Contrastive divergence training of Boltzmann machines where, when
differentiating the energy function, the training must not backpropagate
through the graph that generated the samples from the model.
* Adversarial training, where no backprop should happen through the adversarial
example generation process.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The output tensor. */
class StopGradient {
public:
StopGradient(const ::tensorflow::Scope& scope, ::tensorflow::Input input);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Return a strided slice from `input`.
```
```
Note, most python users will want to use the Python Tensor.__getitem__
or Variable.__getitem__ rather than this op directly.
```
```
The goal of this op is to produce a new tensor with a subset of
the elements from the `n` dimensional `input` tensor. The subset is chosen using
a sequence of `m` sparse range specifications encoded into the arguments
of this function. Note, in some cases
`m` could be equal to `n`, but this need not be the case. Each
range specification entry can be one of the following:
```
* An ellipsis (...). Ellipses are used to imply zero or more dimensions of full-dimension selection and are produced using `ellipsis\_mask`. For example, `foo[...]` is the identity slice.
* A new axis. This is used to insert a new shape=1 dimension and is produced using `new\_axis\_mask`. For example, `foo[:, ...]` where `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor.
* A range `begin:end:stride`. This is used to specify how much to choose from a given dimension. `stride` can be any integer but 0. `begin` is an integer which represents the index of the first value to select while `end` represents the index of the last value to select. The number of values selected in each dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`. `begin` and `end` can be negative where `-1` is the last element, `-2` is the second to last. `begin\_mask` controls whether to replace the explicitly given `begin` with an implicit effective value of `0` if `stride > 0` and `-1` if `stride < 0`. `end\_mask` is analogous but produces the number required to create the largest open interval. For example, given a shape `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do not assume this is equivalent to `foo[0:-1]` which has an effective `begin` and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the first dimension of a tensor while dropping the last two (in the original order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`.
* A single index. This is used to keep only elements that have a given index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a shape `(6,)` tensor. This is encoded in `begin` and `end` and `shrink\_axis\_mask`.
```
Each conceptual range specification is encoded in the op's argument. This
encoding is best understand by considering a non-trivial example. In
particular,
`foo[1, 2:4, None, ..., :-3:-1, :]` will be encoded as
```
begin = [1, 2, x, x, 0, x] # x denotes don't care (usually 0) end = [2, 4, x, x, -3, x] strides = [1, 1, x, x, -1, 1] begin\_mask = 1<<4 | 1<<5 = 48 end\_mask = 1<<5 = 32 ellipsis\_mask = 1<<3 = 8 new\_axis\_mask = 1<<2 = 4 shrink\_axis\_mask = 1<<0 = 1
```
In this case if foo.shape is (5, 5, 5, 5, 5, 5) the final shape of
the slice becomes (2, 1, 5, 5, 2, 5).
Let us walk step by step through each argument specification.
```
```
1. The first argument in the example slice is turned into begin = 1 and
end = begin + 1 = 2. To disambiguate from the original spec 2:4 we
also set the appropriate bit in shrink_axis_mask.
```
```
2. 2:4 is contributes 2, 4, 1 to begin, end, and stride. All masks have
zero bits contributed.
```
```
3. None is a synonym for tf.newaxis. This means insert a dimension of size 1
dimension in the final shape. Dummy values are contributed to begin,
end and stride, while the new_axis_mask bit is set.
```
```
4. ... grab the full ranges from as many dimensions as needed to
fully specify a slice for every dimension of the input shape.
```
```
5. :-3:-1 shows the use of negative indices. A negative index i associated
with a dimension that has shape s is converted to a positive index
s + i. So -1 becomes s-1 (i.e. the last element). This conversion
is done internally so begin, end and strides receive x, -3, and -1.
The appropriate begin_mask bit is set to indicate the start range is the
full range (ignoring the x).
```
```
6. : indicates that the entire contents of the corresponding dimension
is selected. This is equivalent to :: or 0::1. begin, end, and strides
receive 0, 0, and 1, respectively. The appropriate bits in begin_mask and
end_mask are also set.
```
```
Requirements:
0 != strides[i] for i in [0, m)ellipsis_mask must be a power of two (only one ellipsis)
```
```
Args:
* scope: A Scope object
* begin: begin[k] specifies the offset into the kth range specification.
The exact dimension this corresponds to will be determined by context.
Out-of-bounds values will be silently clamped. If the kth bit of
begin_mask then begin[k] is ignored and the full range of the
appropriate dimension is used instead. Negative values causes indexing
to start from the highest element e.g. If foo==[1,2,3] then foo[-1]==3.
* end: end[i] is like begin with the exception that end_mask is
used to determine full ranges.
* strides: strides[i] specifies the increment in the ith specification
after extracting a given element. Negative indices will reverse
the original order. Out or range values are
clamped to [0,dim[i]) if slice[i]>0 or [-1,dim[i]-1] if slice[i] < 0
```
```
Optional attributes (see Attrs):
* begin_mask: a bitmask where a bit i being 1 means to ignore the begin
value and instead use the largest interval possible. At runtime
begin[i] will be replaced with [0, n-1) if stride[i] > 0 or
[-1, n-1] if stride[i] < 0
* end_mask: analogous to begin_mask
* ellipsis_mask: a bitmask where bit i being 1 means the ith
position is actually an ellipsis. One bit at most can be 1.
If ellipsis_mask == 0, then an implicit ellipsis mask of 1 << (m+1)
is provided. This means that foo[3:5] == foo[3:5, ...]. An ellipsis
implicitly creates as many range specifications as necessary to fully
specify the sliced range for every dimension. For example for a 4-dimensional
tensor foo the slice foo[2, ..., 5:8] implies foo[2, :, :, 5:8].
* new_axis_mask: a bitmask where bit i being 1 means the ith
specification creates a new shape 1 dimension. For example
foo[:4, tf.newaxis, :2] would produce a shape (4, 1, 2) tensor.
* shrink_axis_mask: a bitmask where bit i implies that the ith
specification should shrink the dimensionality. begin and end
must imply a slice of size 1 in the dimension. For example in
python one might do foo[:, 3, :] which would result in
shrink_axis_mask being 2.
```
```
Returns:
* Output: The output tensor. */
class StridedSlice {
public:
/// Optional attribute setters for StridedSlice
struct Attrs {
/** a bitmask where a bit i being 1 means to ignore the begin
value and instead use the largest interval possible. At runtime
begin[i] will be replaced with [0, n-1) if stride[i] > 0 or
[-1, n-1] if stride[i] < 0
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs BeginMask(int64 x) {
Attrs ret = *this;
ret.begin_mask_ = x;
return ret;
}
```
```
/** analogous to begin_mask
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs EndMask(int64 x) {
Attrs ret = *this;
ret.end_mask_ = x;
return ret;
}
```
```
/** a bitmask where bit i being 1 means the ith
position is actually an ellipsis. One bit at most can be 1.
If ellipsis_mask == 0, then an implicit ellipsis mask of 1 << (m+1)
is provided. This means that foo[3:5] == foo[3:5, ...]. An ellipsis
implicitly creates as many range specifications as necessary to fully
specify the sliced range for every dimension. For example for a 4-dimensional
tensor foo the slice foo[2, ..., 5:8] implies foo[2, :, :, 5:8].
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs EllipsisMask(int64 x) {
Attrs ret = *this;
ret.ellipsis_mask_ = x;
return ret;
}
```
```
/** a bitmask where bit i being 1 means the ith
specification creates a new shape 1 dimension. For example
foo[:4, tf.newaxis, :2] would produce a shape (4, 1, 2) tensor.
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs NewAxisMask(int64 x) {
Attrs ret = *this;
ret.new_axis_mask_ = x;
return ret;
}
```
```
/** a bitmask where bit i implies that the ith
specification should shrink the dimensionality. begin and end
must imply a slice of size 1 in the dimension. For example in
python one might do foo[:, 3, :] which would result in
shrink_axis_mask being 2.
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs ShrinkAxisMask(int64 x) {
Attrs ret = *this;
ret.shrink_axis_mask_ = x;
return ret;
}
```
```
int64 begin_mask_ = 0;
int64 end_mask_ = 0;
int64 ellipsis_mask_ = 0;
int64 new_axis_mask_ = 0;
int64 shrink_axis_mask_ = 0;
};
StridedSlice(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input begin, tensorflow::Input end,
tensorflow::Input strides);
StridedSlice(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input begin, tensorflow::Input end,
tensorflow::Input strides, const StridedSlice::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs BeginMask(int64 x) {
return Attrs().BeginMask(x);
}
static Attrs EndMask(int64 x) {
return Attrs().EndMask(x);
}
static Attrs EllipsisMask(int64 x) {
return Attrs().EllipsisMask(x);
}
static Attrs NewAxisMask(int64 x) {
return Attrs().NewAxisMask(x);
}
static Attrs ShrinkAxisMask(int64 x) {
return Attrs().ShrinkAxisMask(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Assignvalue to the sliced l-value reference of ref.
```
```
The values of value are assigned to the positions in the variable
ref that are selected by the slice parameters. The slice parameters
begin, end, strides, etc. work exactly as in StridedSlice.
```
```
NOTE this op currently does not support broadcasting and so value's
shape must be exactly the shape produced by the slice of ref.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* Output: The output_ref tensor. */
class StridedSliceAssign {
public:
/// Optional attribute setters for StridedSliceAssign
struct Attrs {
/// Defaults to 0
TF_MUST_USE_RESULT Attrs BeginMask(int64 x) {
Attrs ret = *this;
ret.begin_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EndMask(int64 x) {
Attrs ret = *this;
ret.end_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EllipsisMask(int64 x) {
Attrs ret = *this;
ret.ellipsis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs NewAxisMask(int64 x) {
Attrs ret = *this;
ret.new_axis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs ShrinkAxisMask(int64 x) {
Attrs ret = *this;
ret.shrink_axis_mask_ = x;
return ret;
}
```
```
int64 begin_mask_ = 0;
int64 end_mask_ = 0;
int64 ellipsis_mask_ = 0;
int64 new_axis_mask_ = 0;
int64 shrink_axis_mask_ = 0;
};
StridedSliceAssign(const tensorflow::Scope& scope, tensorflow::Input ref,
tensorflow::Input begin, tensorflow::Input end,
tensorflow::Input strides, tensorflow::Input value);
StridedSliceAssign(const tensorflow::Scope& scope, tensorflow::Input ref,
tensorflow::Input begin, tensorflow::Input end,
tensorflow::Input strides, tensorflow::Input value,
const StridedSliceAssign::Attrs& attrs);
operator ::tensorflow::Output() const { return output_ref; }
operator ::tensorflow::Input() const { return output_ref; }
::tensorflow::Node* node() const { return output_ref.node(); }
```
```
static Attrs BeginMask(int64 x) {
return Attrs().BeginMask(x);
}
static Attrs EndMask(int64 x) {
return Attrs().EndMask(x);
}
static Attrs EllipsisMask(int64 x) {
return Attrs().EllipsisMask(x);
}
static Attrs NewAxisMask(int64 x) {
return Attrs().NewAxisMask(x);
}
static Attrs ShrinkAxisMask(int64 x) {
return Attrs().ShrinkAxisMask(x);
}
```
```
Operation operation;
tensorflow::Output output_ref;
};
```
```
/** Returns the gradient of StridedSlice.
```
```
Since StridedSlice cuts out pieces of its input which is size
shape, its gradient will have the same shape (which is passed here
as shape). The gradient will be zero in any element that the slice
does not select.
```
```
Arguments are the same as StridedSliceGrad with the exception that
dy is the input gradient to be propagated and shape is the
shape of StridedSlice's input.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* Output: The output tensor. */
class StridedSliceGrad {
public:
/// Optional attribute setters for StridedSliceGrad
struct Attrs {
/// Defaults to 0
TF_MUST_USE_RESULT Attrs BeginMask(int64 x) {
Attrs ret = *this;
ret.begin_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EndMask(int64 x) {
Attrs ret = *this;
ret.end_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EllipsisMask(int64 x) {
Attrs ret = *this;
ret.ellipsis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs NewAxisMask(int64 x) {
Attrs ret = *this;
ret.new_axis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs ShrinkAxisMask(int64 x) {
Attrs ret = *this;
ret.shrink_axis_mask_ = x;
return ret;
}
```
```
int64 begin_mask_ = 0;
int64 end_mask_ = 0;
int64 ellipsis_mask_ = 0;
int64 new_axis_mask_ = 0;
int64 shrink_axis_mask_ = 0;
};
StridedSliceGrad(const tensorflow::Scope& scope, tensorflow::Input shape,
tensorflow::Input begin, tensorflow::Input end,
tensorflow::Input strides, tensorflow::Input dy);
StridedSliceGrad(const tensorflow::Scope& scope, tensorflow::Input shape,
tensorflow::Input begin, tensorflow::Input end,
tensorflow::Input strides, tensorflow::Input dy, const
StridedSliceGrad::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs BeginMask(int64 x) {
return Attrs().BeginMask(x);
}
static Attrs EndMask(int64 x) {
return Attrs().EndMask(x);
}
static Attrs EllipsisMask(int64 x) {
return Attrs().EllipsisMask(x);
}
static Attrs NewAxisMask(int64 x) {
return Attrs().NewAxisMask(x);
}
static Attrs ShrinkAxisMask(int64 x) {
return Attrs().ShrinkAxisMask(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Adds sparse updates to an existing tensor according to indices.
```
```
This operation creates a new tensor by adding sparse updates to the passed
in tensor.
This operation is very similar to tf.compat.v1.scatter_nd_add, except that the
updates are added onto an existing tensor (as opposed to a variable). If the
memory for the existing tensor cannot be re-used, a copy is made and updated.
```
```
indices is an integer tensor containing indices into a new tensor of shape
tensor.shape. The last dimension of indices can be at most the rank of
tensor.shape:
```
indices.shape[-1] <= tensor.shape.rank
```
The last dimension of `indices` corresponds to indices into elements
(if `indices.shape[-1] = tensor.shape.rank`) or slices
(if `indices.shape[-1] < tensor.shape.rank`) along dimension
`indices.shape[-1]` of `tensor.shape`. `updates` is a tensor with shape
```
indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
```
The simplest form of `tensor_scatter_nd_add` is to add individual elements to a
tensor by index. For example, say we want to add 4 elements in a rank-1
tensor with 8 elements.
```
```
In Python, this scatter add operation would look like this:
```
```
>>> indices = tf.constant([[4], [3], [1], [7]])
>>> updates = tf.constant([9, 10, 11, 12])
>>> tensor = tf.ones([8], dtype=tf.int32)
>>> updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
>>> updated
```
```
We can also, insert entire slices of a higher rank tensor all at once. For
example, if we wanted to insert two slices in the first dimension of a
rank-3 tensor with two matrices of new values.
```
```
In Python, this scatter add operation would look like this:
```
```
>>> indices = tf.constant([[0], [2]])
>>> updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],
... [7, 7, 7, 7], [8, 8, 8, 8]],
... [[5, 5, 5, 5], [6, 6, 6, 6],
... [7, 7, 7, 7], [8, 8, 8, 8]]])
>>> tensor = tf.ones([4, 4, 4],dtype=tf.int32)
>>> updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
>>> updated
```
```
Note: on CPU, if an out of bound index is found, an error is returned.
On GPU, if an out of bound index is found, the index is ignored.
```
```
Args:
* scope: A Scope object
* tensor: Tensor to copy/update.
* indices: Index tensor.
* updates: Updates to scatter into output.
```
```
Returns:
* `Output`: A new tensor copied from tensor and updates added according to the indices. */
class TensorScatterAdd {
public:
TensorScatterAdd(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input indices, tensorflow::Input updates);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Apply a sparse update to a tensor taking the element-wise maximum.
```
```
Returns a new tensor copied from `tensor` whose values are element-wise maximum between
tensor and updates according to the indices.
```
```
>>> tensor = [0, 0, 0, 0, 0, 0, 0, 0]
>>> indices = [[1], [4], [5]]
>>> updates = [1, -1, 1]
>>> tf.tensor_scatter_nd_max(tensor, indices, updates).numpy()
array([0, 1, 0, 0, 0, 1, 0, 0], dtype=int32)
```
```
Refer to tf.tensor_scatter_nd_update for more details.
```
```
Args:
* scope: A Scope object
* tensor: Tensor to update.
* indices: Index tensor.
* updates: Updates to scatter into output.
```
```
Returns:
* `Output`: A new tensor copied from tensor whose values are element-wise maximum between tensor and updates according to the indices. */
class TensorScatterMax {
public:
TensorScatterMax(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input indices, tensorflow::Input updates);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** TODO: add doc.
```
```
Args:
* scope: A Scope object
* tensor: Tensor to update.
* indices: Index tensor.
* updates: Updates to scatter into output.
```
```
Returns:
* `Output`: A new tensor copied from tensor whose values are element-wise minimum between tensor and updates according to the indices. */
class TensorScatterMin {
public:
TensorScatterMin(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input indices, tensorflow::Input updates);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Subtracts sparse `updates` from an existing tensor according to `indices`.
```
```
This operation creates a new tensor by subtracting sparse `updates` from the
passed in `tensor`.
This operation is very similar to `tf.scatter_nd_sub`, except that the updates
are subtracted from an existing tensor (as opposed to a variable). If the memory
for the existing tensor cannot be re-used, a copy is made and updated.
```
```
`indices` is an integer tensor containing indices into a new tensor of shape
`shape`. The last dimension of `indices` can be at most the rank of `shape`:
```
```
indices.shape[-1] <= shape.rank
```
```
The last dimension of `indices` corresponds to indices into elements
(if `indices.shape[-1] = shape.rank`) or slices
(if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of
`shape`. `updates` is a tensor with shape
```
```
indices.shape[:-1] + shape[indices.shape[-1]:]
```
```
The simplest form of tensor_scatter_sub is to subtract individual elements
from a tensor by index. For example, say we want to insert 4 scattered elements
in a rank-1 tensor with 8 elements.
```
```
In Python, this scatter subtract operation would look like this:
```
python indices = tf.constant([[4], [3], [1], [7]]) updates = tf.constant([9, 10, 11, 12]) tensor = tf.ones([8], dtype=tf.int32) updated = tf.tensor\_scatter\_nd\_sub(tensor, indices, updates) print(updated)
```
The resulting tensor would look like this:
```
```
[1, -10, 1, -9, -8, 1, 1, -11]
```
```
We can also, insert entire slices of a higher rank tensor all at once. For
example, if we wanted to insert two slices in the first dimension of a
rank-3 tensor with two matrices of new values.
```
```
In Python, this scatter add operation would look like this:
```
python indices = tf.constant([[0], [2]]) updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]], [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]]]) tensor = tf.ones([4, 4, 4],dtype=tf.int32) updated = tf.tensor\_scatter\_nd\_sub(tensor, indices, updates) print(updated)
```
The resulting tensor would look like this:
```
```
[[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
```
```
Note that on CPU, if an out of bound index is found, an error is returned.
On GPU, if an out of bound index is found, the index is ignored.
```
```
Args:
* scope: A Scope object
* tensor: Tensor to copy/update.
* indices: Index tensor.
* updates: Updates to scatter into output.
```
```
Returns:
* `Output`: A new tensor copied from tensor and updates subtracted according to the indices. */
class TensorScatterSub {
public:
TensorScatterSub(const tensorflow::Scope& scope, tensorflow::Input tensor,
tensorflow::Input indices, tensorflow::Input updates);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Scatter `updates` into an existing tensor according to `indices`.
```
```
This operation creates a new tensor by applying sparse `updates` to the passed
in `tensor`.
This operation is very similar to tf.scatter_nd, except that the updates are
scattered onto an existing tensor (as opposed to a zero-tensor). If the memory
for the existing tensor cannot be re-used, a copy is made and updated.
```
```
If `indices` contains duplicates, then we pick the last update for the index.
```
```
If an out of bound index is found on CPU, an error is returned.
```
```
**WARNING**: There are some GPU specific semantics for this operation.
```
* If an out of bound index is found, the index is ignored.
* The order in which updates are applied is nondeterministic, so the output will be nondeterministic if `indices` contains duplicates.
```
`indices` is an integer tensor containing indices into a new tensor of shape
`shape`.
```
```
* `indices` must have at least 2 axes: `(num_updates, index_depth)`.
* The last axis of `indices` is how deep to index into `tensor` so this index
depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim`
```
```
if `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements.
if `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input
`tensor`.
```
```
Each `update` has a rank of `tensor.rank - indices.shape[-1]`.
The overall shape of `updates` is:
```
indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
```
For usage examples see the python [tf.tensor_scatter_nd_update](
https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function
```
```
Args:
* scope: A Scope object
* tensor: Tensor to copy/update.
* indices: Index tensor.
* updates: Updates to scatter into output.
```
```
Returns:
* `Output`: A new tensor with the given shape and updates applied according
to the indices. */
class TensorScatterUpdate {
public:
TensorScatterUpdate(const tensorflow::Scope& scope, tensorflow::Input
tensor, tensorflow::Input indices, tensorflow::Input
updates);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Assign `value` to the sliced l-value reference of `input`.
```
```
The values of `value` are assigned to the positions in the tensor `input` that
are selected by the slice parameters. The slice parameters `begin` `end`
`strides` etc. work exactly as in `StridedSlice`.
```
```
NOTE this op currently does not support broadcasting and so `value`'s shape
must be exactly the shape produced by the slice of `input`.
```
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The output tensor. */
class TensorStridedSliceUpdate {
public:
/// Optional attribute setters for TensorStridedSliceUpdate
struct Attrs {
/// Defaults to 0
TF_MUST_USE_RESULT Attrs BeginMask(int64 x) {
Attrs ret = *this;
ret.begin_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EndMask(int64 x) {
Attrs ret = *this;
ret.end_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs EllipsisMask(int64 x) {
Attrs ret = *this;
ret.ellipsis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs NewAxisMask(int64 x) {
Attrs ret = *this;
ret.new_axis_mask_ = x;
return ret;
}
```
```
/// Defaults to 0
TF_MUST_USE_RESULT Attrs ShrinkAxisMask(int64 x) {
Attrs ret = *this;
ret.shrink_axis_mask_ = x;
return ret;
}
```
```
int64 begin_mask_ = 0;
int64 end_mask_ = 0;
int64 ellipsis_mask_ = 0;
int64 new_axis_mask_ = 0;
int64 shrink_axis_mask_ = 0;
};
TensorStridedSliceUpdate(const tensorflow::Scope& scope, tensorflow::Input
input, tensorflow::Input begin, tensorflow::Input
end, tensorflow::Input strides, tensorflow::Input
value);
TensorStridedSliceUpdate(const tensorflow::Scope& scope, tensorflow::Input
input, tensorflow::Input begin, tensorflow::Input
end, tensorflow::Input strides, tensorflow::Input
value, const TensorStridedSliceUpdate::Attrs& attrs);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
static Attrs BeginMask(int64 x) {
return Attrs().BeginMask(x);
}
static Attrs EndMask(int64 x) {
return Attrs().EndMask(x);
}
static Attrs EllipsisMask(int64 x) {
return Attrs().EllipsisMask(x);
}
static Attrs NewAxisMask(int64 x) {
return Attrs().NewAxisMask(x);
}
static Attrs ShrinkAxisMask(int64 x) {
return Attrs().ShrinkAxisMask(x);
}
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Constructs a tensor by tiling a given tensor.
```
```
This operation creates a new tensor by replicating `input` `multiples` times.
The output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements,
and the values of `input` are replicated `multiples[i]` times along the 'i'th
dimension. For example, tiling `[a b c d]` by `[2]` produces
`[a b c d a b c d]`.
```
```
>>> a = tf.constant([[1,2,3],[4,5,6]], tf.int32)
>>> b = tf.constant([1,2], tf.int32)
>>> tf.tile(a, b)
>>> c = tf.constant([2,1], tf.int32)
>>> tf.tile(a, c)
>>> d = tf.constant([2,2], tf.int32)
>>> tf.tile(a, d)
```
```
Args:
* scope: A Scope object
* input: 1-D or higher.
* multiples: 1-D. Length must be the same as the number of dimensions in `input`
```
```
Returns:
* `Output`: The output tensor. */
class Tile {
public:
Tile(const tensorflow::Scope& scope, tensorflow::Input input,
tensorflow::Input multiples);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Shuffle dimensions of x according to a permutation.
```
```
The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy:
`y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]`
```
```
Args:
* scope: A Scope object
```
```
Returns:
* `Output`: The y tensor. */
class Transpose {
public:
Transpose(const tensorflow::Scope& scope, tensorflow::Input x,
tensorflow::Input perm);
operator ::tensorflow::Output() const { return y; }
operator ::tensorflow::Input() const { return y; }
::tensorflow::Node* node() const { return y.node(); }
```
```
Operation operation;
tensorflow::Output y;
};
```
```
/** Finds unique elements in a 1-D tensor.
```
```
This operation returns a tensor `y` containing all of the unique elements of `x`
sorted in the same order that they occur in `x`; `x` does not need to be sorted.
This operation also returns a tensor `idx` the same size as `x` that contains
the index of each value of `x` in the unique output `y`. In other words:
```
```
`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`
```
```
Examples:
```
tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
=========================================
y, idx = unique(x) y ==> [1, 2, 4, 7, 8] idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
tensor 'x' is [4, 5, 1, 2, 3, 3, 4, 5]
======================================
y, idx = unique(x) y ==> [4, 5, 1, 2, 3] idx ==> [0, 1, 2, 3, 4, 4, 0, 1]
```
Args:
* scope: A Scope object
* x: 1-D.
```
```
Returns:
* `Output` y: 1-D.
* `Output` idx: 1-D. */
class Unique {
public:
/// Optional attribute setters for Unique
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutIdx(DataType x) {
Attrs ret = *this;
ret.out_idx_ = x;
return ret;
}
```
```
DataType out_idx_ = DT_INT32;
};
Unique(const ::tensorflow::Scope& scope, ::tensorflow::Input x);
Unique(const tensorflow::Scope& scope, tensorflow::Input x, const
Unique::Attrs& attrs);
```
```
static Attrs OutIdx(DataType x) {
return Attrs().OutIdx(x);
}
```
```
Operation operation;
tensorflow::Output y;
tensorflow::Output idx;
};
```
```
/** Finds unique elements along an axis of a tensor.
```
```
This operation either returns a tensor `y` containing unique elements
along the `axis` of a tensor. The returned unique elements is sorted
in the same order as they occur along `axis` in `x`.
This operation also returns a tensor `idx` that is the same size as
the number of the elements in `x` along the `axis` dimension. It
contains the index in the unique output `y`.
In other words, for an `1-D` tensor `x` with `axis = None:
```
```
`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`
```
```
For example:
```
tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
=========================================
y, idx = unique(x) y ==> [1, 2, 4, 7, 8] idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
```
For an `2-D` tensor `x` with `axis = 0`:
```
tensor 'x' is [[1, 0, 0],
=========================
[1, 0, 0],
==========
[2, 0, 0]]
==========
y, idx = unique(x, axis=0) y ==> [[1, 0, 0], [2, 0, 0]] idx ==> [0, 0, 1]
```
For an `2-D` tensor `x` with `axis = 1`:
```
tensor 'x' is [[1, 0, 0],
=========================
[1, 0, 0],
==========
[2, 0, 0]]
==========
y, idx = unique(x, axis=1) y ==> [[1, 0], [1, 0], [2, 0]] idx ==> [0, 1, 1]
```
Args:
* scope: A Scope object
* x: A `Tensor`.
* axis: A `Tensor` of type `int32` (default: None). The axis of the Tensor to
find the unique elements.
```
```
Returns:
* `Output` y: A `Tensor`. Unique elements along the `axis` of `Tensor` x.
* `Output` idx: A 1-D Tensor. Has the same type as x that contains the index of each
value of x in the output y. */
class UniqueV2 {
public:
/// Optional attribute setters for UniqueV2
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutIdx(DataType x) {
Attrs ret = *this;
ret.out_idx_ = x;
return ret;
}
```
```
DataType out_idx_ = DT_INT32;
};
UniqueV2(const tensorflow::Scope& scope, tensorflow::Input x,
tensorflow::Input axis);
UniqueV2(const tensorflow::Scope& scope, tensorflow::Input x,
tensorflow::Input axis, const UniqueV2::Attrs& attrs);
```
```
static Attrs OutIdx(DataType x) {
return Attrs().OutIdx(x);
}
```
```
Operation operation;
tensorflow::Output y;
tensorflow::Output idx;
};
```
```
/** Finds unique elements in a 1-D tensor.
```
```
This operation returns a tensor `y` containing all of the unique elements of `x`
sorted in the same order that they occur in `x`. This operation also returns a
tensor `idx` the same size as `x` that contains the index of each value of `x`
in the unique output `y`. Finally, it returns a third tensor `count` that
contains the count of each element of `y` in `x`. In other words:
```
```
`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`
```
```
For example:
```
tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
=========================================
y, idx, count = unique\_with\_counts(x) y ==> [1, 2, 4, 7, 8] idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4] count ==> [2, 1, 3, 1, 2]
```
Args:
* scope: A Scope object
* x: 1-D.
```
```
Returns:
* `Output` y: 1-D.
* `Output` idx: 1-D.
* `Output` count: 1-D. */
class UniqueWithCounts {
public:
/// Optional attribute setters for UniqueWithCounts
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutIdx(DataType x) {
Attrs ret = *this;
ret.out_idx_ = x;
return ret;
}
```
```
DataType out_idx_ = DT_INT32;
};
UniqueWithCounts(const ::tensorflow::Scope& scope, ::tensorflow::Input x);
UniqueWithCounts(const tensorflow::Scope& scope, tensorflow::Input x, const
UniqueWithCounts::Attrs& attrs);
```
```
static Attrs OutIdx(DataType x) {
return Attrs().OutIdx(x);
}
```
```
Operation operation;
tensorflow::Output y;
tensorflow::Output idx;
tensorflow::Output count;
};
```
```
/** Finds unique elements along an axis of a tensor.
```
```
This operation either returns a tensor `y` containing unique elements
along the `axis` of a tensor. The returned unique elements is sorted
in the same order as they occur along `axis` in `x`.
This operation also returns a tensor `idx` and a tensor `count`
that are the same size as the number of the elements in `x` along the
`axis` dimension. The `idx` contains the index in the unique output `y`
and the `count` contains the count in the unique output `y`.
In other words, for an `1-D` tensor `x` with `axis = None:
```
```
`y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]`
```
```
For example:
```
x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8]) y, idx, count = UniqueWithCountsV2(x, axis = [0]) y ==> [1, 2, 4, 7, 8] idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4] count ==> [2, 1, 3, 1, 2]
```
For a `2-D` tensor `x` with `axis = 0`:
```
x = tf.constant([[1, 0, 0], [1, 0, 0], [2, 0, 0]]) y, idx, count = UniqueWithCountsV2(x, axis=[0]) y ==> [[1, 0, 0], [2, 0, 0]] idx ==> [0, 0, 1] count ==> [2, 1]
```
For a `2-D` tensor `x` with `axis = 1`:
```
x = tf.constant([[1, 0, 0], [1, 0, 0], [2, 0, 0]]) y, idx, count = UniqueWithCountsV2(x, axis=[1]) y ==> [[1, 0], [1, 0], [2, 0]] idx ==> [0, 1, 1] count ==> [1, 2]
```
Args:
* scope: A Scope object
* x: A `Tensor`.
* axis: A `Tensor` of type `int32` (default: None). The axis of the Tensor to
find the unique elements.
```
```
Returns:
* `Output` y: A `Tensor`. Unique elements along the `axis` of `Tensor` x.
* `Output` idx: A 1-D Tensor. Has the same type as x that contains the index of each
value of x in the output y.
* `Output` count: A 1-D Tensor. The count of each value of x in the output y. */
class UniqueWithCountsV2 {
public:
/// Optional attribute setters for UniqueWithCountsV2
struct Attrs {
/// Defaults to DT_INT32
TF_MUST_USE_RESULT Attrs OutIdx(DataType x) {
Attrs ret = *this;
ret.out_idx_ = x;
return ret;
}
```
```
DataType out_idx_ = DT_INT32;
};
UniqueWithCountsV2(const tensorflow::Scope& scope, tensorflow::Input x,
tensorflow::Input axis);
UniqueWithCountsV2(const tensorflow::Scope& scope, tensorflow::Input x,
tensorflow::Input axis, const UniqueWithCountsV2::Attrs&
attrs);
```
```
static Attrs OutIdx(DataType x) {
return Attrs().OutIdx(x);
}
```
```
Operation operation;
tensorflow::Output y;
tensorflow::Output idx;
tensorflow::Output count;
};
```
```
/** Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors.
```
```
Unpacks `num` tensors from `value` by chipping it along the `axis` dimension.
For example, given a tensor of shape `(A, B, C, D)`;
```
```
If `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]`
and each tensor in `output` will have shape `(B, C, D)`. (Note that the
dimension unpacked along is gone, unlike `split`).
```
```
If `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]`
and each tensor in `output` will have shape `(A, C, D)`.
Etc.
```
```
This is the opposite of `pack`.
```
```
Args:
* scope: A Scope object
* value: 1-D or higher, with `axis` dimension size equal to `num`.
```
```
Optional attributes (see `Attrs`):
* axis: Dimension along which to unpack. Negative values wrap around, so the
valid range is `[-R, R)`.
```
```
Returns:
* `OutputList`: The list of tensors unpacked from `value`. */
class Unstack {
public:
/// Optional attribute setters for Unstack
struct Attrs {
/** Dimension along which to unpack. Negative values wrap around, so the
valid range is `[-R, R)`.
```
```
Defaults to 0 */
TF_MUST_USE_RESULT Attrs Axis(int64 x) {
Attrs ret = *this;
ret.axis_ = x;
return ret;
}
```
```
int64 axis_ = 0;
};
Unstack(const ::tensorflow::Scope& scope, ::tensorflow::Input value, int64 num);
Unstack(const tensorflow::Scope& scope, tensorflow::Input value, int64 num,
const Unstack::Attrs& attrs);
tensorflow::Output operator[](size_t index) const { return output[index]; }
```
```
static Attrs Axis(int64 x) {
return Attrs().Axis(x);
}
```
```
Operation operation;
::tensorflow::OutputList output;
};
```
```
/** Converts an array of flat indices into a tuple of coordinate arrays.
```
```
Example:
```
y = tf.unravel\_index(indices=[2, 5, 7], dims=[3, 3]) 'dims' represent a hypothetical (3, 3) tensor of indices:
=========================================================
[[0, 1, *2*],
=============
[3, 4, *5*],
============
[6, *7*, 8]]
============
For each entry from 'indices', this operation returns
=====================================================
its coordinates (marked with '\*'), such as
===========================================
2 ==> (0, 2)
============
5 ==> (1, 2)
============
7 ==> (2, 1)
============
y ==> [[0, 1, 2], [2, 2, 1]]
```
(numpy)
Equivalent to np.unravel_index
```
```
Args:
* scope: A Scope object
* indices: An 0-D or 1-D `int` Tensor whose elements are indices into the
flattened version of an array of dimensions dims.
* dims: An 1-D `int` Tensor. The shape of the array to use for unraveling
indices.
```
```
Returns:
* `Output`: An 2-D (or 1-D if indices is 0-D) tensor where each row has the
same shape as the indices array. */
class UnravelIndex {
public:
UnravelIndex(const tensorflow::Scope& scope, tensorflow::Input indices,
tensorflow::Input dims);
operator ::tensorflow::Output() const { return output; }
operator ::tensorflow::Input() const { return output; }
::tensorflow::Node* node() const { return output.node(); }
```
```
Operation operation;
tensorflow::Output output;
};
```
```
/** Returns locations of nonzero / true values in a tensor.
```
```
This operation returns the coordinates of true elements in `condition`. The
coordinates are returned in a 2-D tensor where the first dimension (rows)
represents the number of true elements, and the second dimension (columns)
represents the coordinates of the true elements. Keep in mind, the shape of
the output tensor can vary depending on how many true values there are in
`condition`. Indices are output in row-major order.
```
```
For example:
```
'input' tensor is [[True, False]
================================
[True, False]]
==============
'input' has two true values, so output has two coordinates.
===========================================================
'input' has rank of 2, so coordinates have two indices.
=======================================================
where(input) ==> [[0, 0], [1, 0]]
`condition` tensor is [[[True, False]
======================================
[True, False]]
==============
[[False, True]
==============
[False, True]]
==============
[[False, False]
===============
[False, True]]]
===============
'input' has 5 true values, so output has 5 coordinates.
=======================================================
'input' has rank of 3, so coordinates have three indices.
=========================================================
where(input) ==> [[0, 0, 0], [0, 1, 0], [1, 0, 1], [1, 1, 1], [2, 1, 1]]
`condition` tensor is [[[1.5, 0.0]
===================================
[-0.5, 0.0]]
============
[[0.0, 0.25]
============
[0.0, 0.75]]
============
[[0.0, 0.0]
===========
[0.0, 0.01]]]
=============
'input' has 5 nonzero values, so output has 5 coordinates.
==========================================================
'input' has rank of 3, so coordinates have three indices.
=========================================================
where(input) ==> [[0, 0, 0], [0, 1, 0], [1, 0, 1], [1, 1, 1], [2, 1, 1]]
`condition` tensor is [[[1.5 + 0.0j, 0.0 + 0.0j]
=================================================
[0.0 + 0.5j, 0.0 + 0.0j]]
=========================
[[0.0 + 0.0j, 0.25 + 1.5j]
==========================
[0.0 + 0.0j, 0.75 + 0.0j]]
==========================
[[0.0 + 0.0j, 0.0 + 0.0j]
=========================
[0.0 + 0.0j, 0.01 + 0.0j]]]
===========================
'input' has 5 nonzero magnitude values, so output has 5 coordinates.
====================================================================
'input' has rank of 3, so coordinates have three indices.
=========================================================
where(input) ==> [[0, 0, 0], [0, 1, 0], [1, 0, 1], [1, 1, 1], [2, 1, 1]] ```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The index tensor.
| Constructors and Destructors |
| --- |
| `[Where](#classtensorflow_1_1ops_1_1_where_1a3e4c07125f4b04d6f3a0f99a616273de)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) condition)` |
| Public attributes |
| --- |
| `[index](#classtensorflow_1_1ops_1_1_where_1aa3b91b7d267d5cee38568a7d1f97647d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_where_1ad713509ff4e38a2f5241d9b2cee7b296)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_where_1a76eb69d2e854554e8ae583dba19f1df4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_where_1a80da544c59726a48be37767fb8fe3c91)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_where_1a5662e0fc5b2303a6072fb9aba2cec345)() const` | |
Public attributes
-----------------
### index
```
::tensorflow::Output index
```
### operation
```
Operation operation
```
Public functions
----------------
### Where
```
Where(
const ::tensorflow::Scope & scope,
::tensorflow::Input condition
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResourceApplyAdagrad tensorflow::ops::ResourceApplyAdagrad
=====================================
`#include <training_ops.h>`
Update '\*var' according to the adagrad scheme.
Summary
-------
accum += grad \* grad var -= lr \* grad \* (1 / sqrt(accum))
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyAdagrad](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_1a945ae1849c5d6da01aef4e124d0659a1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyAdagrad](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_1a63f3b55f0f6bb7a1e2d74e72b0cd58cf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyAdagrad::Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_1a50c4f76c31e97e32ee0ec9c8e3f312eb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_1a265fd6706ecf381808bf48ee7e401434)() const` | |
| Public static functions |
| --- |
| `[UpdateSlots](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_1a46a2f3af7fa6462d62bafd7d000b7f2d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_adagrad_1aadb2eb3840bbbc24989cf19471f3dd01)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyAdagrad::Attrs](../../../struct/tensorflow/ops/resource-apply-adagrad/attrs) | Optional attribute setters for [ResourceApplyAdagrad](resource-apply-adagrad#classtensorflow_1_1ops_1_1_resource_apply_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyAdagrad
```
ResourceApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad
)
```
### ResourceApplyAdagrad
```
ResourceApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
const ResourceApplyAdagrad::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UpdateSlots
```
Attrs UpdateSlots(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::MatrixDiagPart tensorflow::ops::MatrixDiagPart
===============================
`#include <array_ops.h>`
Returns the batched diagonal part of a batched tensor.
Summary
-------
This operation returns a tensor with the `diagonal` part of the batched `input`. The `diagonal` part is computed as follows:
Assume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a tensor of rank `k - 1` with dimensions `[I, J, K, ..., min(M, N)]` where:
`diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n]`.
The input must be at least a matrix.
For example:
```
# 'input' is [[[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]],
[[5, 0, 0, 0]
[0, 6, 0, 0]
[0, 0, 7, 0]
[0, 0, 0, 8]]]
```
```
and input.shape = (2, 4, 4)
```
```
tf.matrix_diag_part(input) ==> [[1, 2, 3, 4], [5, 6, 7, 8]]
```
```
which has shape (2, 4)
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `k` tensor where `k >= 2`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The extracted diagonal(s) having shape `diagonal.shape = input.shape[:-2] + [min(input.shape[-2:])]`.
| Constructors and Destructors |
| --- |
| `[MatrixDiagPart](#classtensorflow_1_1ops_1_1_matrix_diag_part_1a2ff08591126639a356e8ddb7b1bbe901)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[diagonal](#classtensorflow_1_1ops_1_1_matrix_diag_part_1aefc6c0270b1e5a8ecca5253aa3197301)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_diag_part_1a2ee7a3d61dc294c15227bb4a4fd796fb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_diag_part_1a6310cbc4148604ca613410d6d3f6794e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_diag_part_1ab168eaa21921f9a0ff6ca197fbbbd8da)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_diag_part_1a6ac92f6b3dfd62c3ef3c08777c62d543)() const` | |
Public attributes
-----------------
### diagonal
```
::tensorflow::Output diagonal
```
### operation
```
Operation operation
```
Public functions
----------------
### MatrixDiagPart
```
MatrixDiagPart(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Sqrt tensorflow::ops::Sqrt
=====================
`#include <math_ops.h>`
Computes square root of x element-wise.
Summary
-------
I.e., \(y = \sqrt{x} = x^{1/2}\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Sqrt](#classtensorflow_1_1ops_1_1_sqrt_1a669a37187b07c3b1b60cdbbcc94511d4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sqrt_1abf3ff0287be63e397099104e0b2a0c9b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_sqrt_1acc16b10c3678d5cf01da6f1f1c36dc47)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sqrt_1a0b50c8aef3657e33491a63b1a029be58)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sqrt_1aa2bb777cf2c707a74bfbf9f15771bf02)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sqrt_1a7ae8e183f1459545c8e4673232fc6d21)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Sqrt
```
Sqrt(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::NonMaxSuppressionV4 tensorflow::ops::NonMaxSuppressionV4
====================================
`#include <image_ops.h>`
Greedily selects a subset of bounding boxes in descending order of score,.
Summary
-------
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected\_indices = tf.image.non\_max\_suppression\_v2( boxes, scores, max\_output\_size, iou\_threshold, score\_threshold) selected\_boxes = tf.gather(boxes, selected\_indices)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* boxes: A 2-D float tensor of shape `[num_boxes, 4]`.
* scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).
* max\_output\_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
* iou\_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
* score\_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/non-max-suppression-v4/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs)`):
* pad\_to\_max\_output\_size: If true, the output `selected_indices` is padded to be of length `max_output_size`. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` selected\_indices: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
* `[Output](../output#classtensorflow_1_1_output)` valid\_outputs: A 0-D integer tensor representing the number of valid elements in `selected_indices`, with the valid elements appearing first.
| Constructors and Destructors |
| --- |
| `[NonMaxSuppressionV4](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1ac241f89469a7188f8d9b5c0daa2441f4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold)` |
| `[NonMaxSuppressionV4](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1afc8c9e7cedb3678900fa3bcf995aee11)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold, const [NonMaxSuppressionV4::Attrs](../../../struct/tensorflow/ops/non-max-suppression-v4/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a68c64a50fa3dd5b983f6e09e61b92eab)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[selected\_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a3f301cbbf0cd3b82a64c243b1e357fa6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[valid\_outputs](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a47653a5cde7a40dd1801dfc699e2f429)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[PadToMaxOutputSize](#classtensorflow_1_1ops_1_1_non_max_suppression_v4_1a67d61f68bcfca71cdf3f27c979f2ecd2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/non-max-suppression-v4/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::NonMaxSuppressionV4::Attrs](../../../struct/tensorflow/ops/non-max-suppression-v4/attrs) | Optional attribute setters for [NonMaxSuppressionV4](non-max-suppression-v4#classtensorflow_1_1ops_1_1_non_max_suppression_v4). |
Public attributes
-----------------
### operation
```
Operation operation
```
### selected\_indices
```
::tensorflow::Output selected_indices
```
### valid\_outputs
```
::tensorflow::Output valid_outputs
```
Public functions
----------------
### NonMaxSuppressionV4
```
NonMaxSuppressionV4(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold
)
```
### NonMaxSuppressionV4
```
NonMaxSuppressionV4(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold,
const NonMaxSuppressionV4::Attrs & attrs
)
```
Public static functions
-----------------------
### PadToMaxOutputSize
```
Attrs PadToMaxOutputSize(
bool x
)
```
tensorflow_cpp tensorflow::ops::DrawBoundingBoxesV2 tensorflow::ops::DrawBoundingBoxesV2
====================================
`#include <image_ops.h>`
Draw bounding boxes on a batch of images.
Summary
-------
Outputs a copy of `images` but draws on top of the pixels zero or more bounding boxes specified by the locations in `boxes`. The coordinates of the each bounding box in `boxes` are encoded as `[y_min, x_min, y_max, x_max]`. The bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and height of the underlying image.
For example, if an image is 100 x 200 pixels (height x width) and the bounding box is `[0.1, 0.2, 0.5, 0.9]`, the upper-left and bottom-right coordinates of the bounding box will be `(40, 10)` to `(100, 50)` (in (x,y) coordinates).
Parts of the bounding box may fall outside the image.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 4-D with shape `[batch, height, width, depth]`. A batch of images.
* boxes: 3-D with shape `[batch, num_bounding_boxes, 4]` containing bounding boxes.
* colors: 2-D. A list of RGBA colors to cycle through for the boxes.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with the same shape as `images`. The batch of input images with bounding boxes drawn on the images.
| Constructors and Destructors |
| --- |
| `[DrawBoundingBoxesV2](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_v2_1a045daabb9f82e495abcb25389793c47f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) colors)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_v2_1a7c6fe4fe1de16e31ab6399296c433a05)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_v2_1a047b31504fdafafad15a5665c95513b7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_v2_1a428527239d4a4cdfcbd18ec15ebe9584)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_v2_1a29bc76dba2f81b97780d12396085ea46)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_draw_bounding_boxes_v2_1a216f8e9d2152744c9b7522113495dfe4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DrawBoundingBoxesV2
```
DrawBoundingBoxesV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input boxes,
::tensorflow::Input colors
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MatrixDiagPartV2 tensorflow::ops::MatrixDiagPartV2
=================================
`#include <array_ops.h>`
Returns the batched diagonal part of a batched tensor.
Summary
-------
Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched `input`.
Assume `input` has `r` dimensions `[I, J, ..., L, M, N]`. Let `max_diag_len` be the maximum length among all diagonals to be extracted, `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` Let `num_diags` be the number of diagonals to extract, `num_diags = k[1] - k[0] + 1`.
If `num_diags == 1`, the output tensor is of rank `r - 1` with shape `[I, J, ..., L, max_diag_len]` and values:
```
diagonal[i, j, ..., l, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
```
where `y = max(-k[1], 0)`
, `x = max(k[1], 0)`
. Otherwise, the output tensor has rank `r` with dimensions `[I, J, ..., L, num_diags, max_diag_len]` with values:
```
diagonal[i, j, ..., l, m, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
```
where `d = k[1] - m`
, `y = max(-d, 0)`
, and `x = max(d, 0)`
. The input must be at least a matrix.
For example:
```
input = np.array([[[1, 2, 3, 4], # Input shape: (2, 3, 4)
[5, 6, 7, 8],
[9, 8, 7, 6]],
[[5, 4, 3, 2],
[1, 2, 3, 4],
[5, 6, 7, 8]]])
```
```
# A main diagonal from each batch.
tf.matrix_diag_part(input) ==> [[1, 6, 7], # Output shape: (2, 3)
[5, 2, 7]]
```
```
# A superdiagonal from each batch.
tf.matrix_diag_part(input, k = 1)
==> [[2, 7, 6], # Output shape: (2, 3)
[4, 3, 8]]
```
```
# A tridiagonal band from each batch.
tf.matrix_diag_part(input, k = (-1, 1))
==> [[[2, 7, 6], # Output shape: (2, 3, 3)
[1, 6, 7],
[5, 8, 0]],
[[4, 3, 8],
[5, 2, 7],
[1, 6, 0]]]
```
```
# Padding value = 9
tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
==> [[[4, 9, 9], # Output shape: (2, 3, 3)
[3, 8, 9],
[2, 7, 6]],
[[2, 9, 9],
[3, 4, 9],
[4, 3, 8]]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `r` tensor where `r >= 2`.
* k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. `k[0]` must not be larger than `k[1]`.
* padding\_value: The value to fill the area outside the specified diagonal band with. Default is 0.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The extracted diagonal(s).
| Constructors and Destructors |
| --- |
| `[MatrixDiagPartV2](#classtensorflow_1_1ops_1_1_matrix_diag_part_v2_1ad3de7ab4ab1196ff0eb0a0b9712563ef)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, ::[tensorflow::Input](../input#classtensorflow_1_1_input) padding_value)` |
| Public attributes |
| --- |
| `[diagonal](#classtensorflow_1_1ops_1_1_matrix_diag_part_v2_1a7a8892ae88249cf5f89b97544d71a59c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_diag_part_v2_1aefc836bb535eab5db669667a152eba42)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_diag_part_v2_1a0b20ceb05713921670ce29cf7671a152)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_diag_part_v2_1acb91e8a485455813fcd8d9d3558c793b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_diag_part_v2_1a18e6d0e922c930c2880112f18f2ac011)() const` | |
Public attributes
-----------------
### diagonal
```
::tensorflow::Output diagonal
```
### operation
```
Operation operation
```
Public functions
----------------
### MatrixDiagPartV2
```
MatrixDiagPartV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input k,
::tensorflow::Input padding_value
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ApplyFtrl tensorflow::ops::ApplyFtrl
==========================
`#include <training_ops.h>`
Update '\*var' according to the Ftrl-proximal scheme.
Summary
-------
accum\_new = accum + grad \* grad linear += grad - (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-ftrl/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyFtrl](#classtensorflow_1_1ops_1_1_apply_ftrl_1aac92c9a511a285b2ba2fd70bb8a9162a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[ApplyFtrl](#classtensorflow_1_1ops_1_1_apply_ftrl_1a08ae5f59e96c0806cac695b49d0b7e6c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [ApplyFtrl::Attrs](../../../struct/tensorflow/ops/apply-ftrl/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_ftrl_1a60bfef0fb8957ad8ebd90bcc1b17deb5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_ftrl_1a4ce2fdad41c33119e072faa142ab6388)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_ftrl_1a83ed3b447bb12a6a2026a5ecd546311c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_ftrl_1a93e6e2aec1e38ede37126e36574daf64)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_ftrl_1aae1ab05c604dfd771e781b62fa213b30)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_apply_ftrl_1ae1a730cebef5fe012c38da4467c4c7fe)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-ftrl/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_ftrl_1a1052290b6434db12d630a2e9d0b1b197)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-ftrl/attrs#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyFtrl::Attrs](../../../struct/tensorflow/ops/apply-ftrl/attrs) | Optional attribute setters for [ApplyFtrl](apply-ftrl#classtensorflow_1_1ops_1_1_apply_ftrl). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyFtrl
```
ApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power
)
```
### ApplyFtrl
```
ApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power,
const ApplyFtrl::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseFillEmptyRowsGrad tensorflow::ops::SparseFillEmptyRowsGrad
========================================
`#include <sparse_ops.h>`
The gradient of [SparseFillEmptyRows](sparse-fill-empty-rows#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows).
Summary
-------
Takes vectors reverse\_index\_map, shaped `[N]`, and grad\_values, shaped `[N_full]`, where `N_full >= N` and copies data into either `d_values` or `d_default_value`. Here `d_values` is shaped `[N]` and `d_default_value` is a scalar.
d\_values[j] = grad\_values[reverse\_index\_map[j]] d\_default\_value = sum\_{k : 0 .. N\_full - 1} ( grad\_values[k] \* 1{k not in reverse\_index\_map})
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reverse\_index\_map: 1-D. The reverse index map from [SparseFillEmptyRows](sparse-fill-empty-rows#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows).
* grad\_values: 1-D. The gradients from backprop.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` d\_values: 1-D. The backprop into values.
* `[Output](../output#classtensorflow_1_1_output)` d\_default\_value: 0-D. The backprop into default\_value.
| Constructors and Destructors |
| --- |
| `[SparseFillEmptyRowsGrad](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_grad_1ada5dd8406dc685e9cef6fb62d22ef08a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reverse_index_map, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad_values)` |
| Public attributes |
| --- |
| `[d\_default\_value](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_grad_1a390e699bba2fa2de13aa830fa180150b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[d\_values](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_grad_1a13ae288ea1b435bc21beaf155bb49a66)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_grad_1a5d59df27d9ed5efa484e261d96d2fb65)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### d\_default\_value
```
::tensorflow::Output d_default_value
```
### d\_values
```
::tensorflow::Output d_values
```
### operation
```
Operation operation
```
Public functions
----------------
### SparseFillEmptyRowsGrad
```
SparseFillEmptyRowsGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input reverse_index_map,
::tensorflow::Input grad_values
)
```
tensorflow_cpp tensorflow::ops::AdjustContrast tensorflow::ops::AdjustContrast
===============================
`#include <image_ops.h>`
Adjust the contrast of one or more images.
Summary
-------
`images` is a tensor of at least 3 dimensions. The last 3 dimensions are interpreted as `[height, width, channels]`. The other dimensions only represent a collection of images, such as `[batch, height, width, channels].`
Contrast is adjusted independently for each channel of each image.
For each channel, the Op first computes the mean of the image pixels in the channel and then adjusts each component of each pixel to `(x - mean) * contrast_factor + mean`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: Images to adjust. At least 3-D.
* contrast\_factor: A float multiplier for adjusting contrast.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The contrast-adjusted image or images.
| Constructors and Destructors |
| --- |
| `[AdjustContrast](#classtensorflow_1_1ops_1_1_adjust_contrast_1a817234337682fcf4afdfe94eb7c6bcc2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contrast_factor)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_adjust_contrast_1ad06f8f55756cdb0ea76bda27f433c069)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_adjust_contrast_1ac8e60cb2d1938fbf4467419d9bed3e27)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_adjust_contrast_1afef7b99274258f8232f30829973001b3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_adjust_contrast_1ad6c68cabac0d2c21e087ed3547d64eae)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_adjust_contrast_1a56529eeed8eb996474cf2f47f8658ca2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### AdjustContrast
```
AdjustContrast(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input contrast_factor
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Sign tensorflow::ops::Sign
=====================
`#include <math_ops.h>`
Returns an element-wise indication of the sign of a number.
Summary
-------
`y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`.
For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.
Example usage: tf.math.sign([0., 2., -3.])
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Sign](#classtensorflow_1_1ops_1_1_sign_1a869bfb986acd409decd0b81431b64ee1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sign_1ac2fbb1819b86265978fb432cbfb2815a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_sign_1a2813ef6287e0880c694bb2f4d4630d05)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sign_1a893afd2455d9076ab06676f83c02bea5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sign_1a70860555aff56a27fb18552c34265f31)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sign_1a9118daa56e125d739e13c16b3ff96b2d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Sign
```
Sign(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApplyAdam tensorflow::ops::ApplyAdam
==========================
`#include <training_ops.h>`
Update '\*var' according to the Adam algorithm.
Summary
-------
$$\text{lr}\_t := \mathrm{lr} \cdot \frac{\sqrt{1 - \beta\_2^t} }{1 - \beta\_1^t}$$ $$m\_t := \beta\_1 \cdot m\_{t-1} + (1 - \beta\_1) \cdot g$$ $$v\_t := \beta\_2 \cdot v\_{t-1} + (1 - \beta\_2) \cdot g^2$$ $$\text{var} := \begin{cases} \text{var} - (m\_t \beta\_1 + g \cdot (1 - \beta\_1))\cdot\text{lr}\_t/(\sqrt{v\_t} + \epsilon), &\text{if use\_nesterov}\\ \text{var} - m\_t \cdot \text{lr}\_t /(\sqrt{v\_t} + \epsilon), &\text{otherwise} \end{cases}$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* v: Should be from a Variable().
* beta1\_power: Must be a scalar.
* beta2\_power: Must be a scalar.
* lr: Scaling factor. Must be a scalar.
* beta1: Momentum factor. Must be a scalar.
* beta2: Momentum factor. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-adam/attrs#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, uses the nesterov update.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyAdam](#classtensorflow_1_1ops_1_1_apply_adam_1a63f38ab9210b19bbb905e9d494fd0d7c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyAdam](#classtensorflow_1_1ops_1_1_apply_adam_1a23c9c116f231e976487216fbf1d880dd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyAdam::Attrs](../../../struct/tensorflow/ops/apply-adam/attrs#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_adam_1a56261a4d240b654e6a61c42931d3b847)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_adam_1a51b86c03755b5fa8584c9228a13594d2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_adam_1aca5ba972ba714c19db3728d2dab29a8e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_adam_1a8e17d2267864bd25f3ab523a287abb8a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_adam_1a596890f0d578e64a6f55540e249ca5c8)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_adam_1adf5062f34d44b504f428d128fcfecf94)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-adam/attrs#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_apply_adam_1ae368b25e083d00d0d74551be052064c3)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-adam/attrs#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyAdam::Attrs](../../../struct/tensorflow/ops/apply-adam/attrs) | Optional attribute setters for [ApplyAdam](apply-adam#classtensorflow_1_1ops_1_1_apply_adam). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyAdam
```
ApplyAdam(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input v,
::tensorflow::Input beta1_power,
::tensorflow::Input beta2_power,
::tensorflow::Input lr,
::tensorflow::Input beta1,
::tensorflow::Input beta2,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ApplyAdam
```
ApplyAdam(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input v,
::tensorflow::Input beta1_power,
::tensorflow::Input beta2_power,
::tensorflow::Input lr,
::tensorflow::Input beta1,
::tensorflow::Input beta2,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ApplyAdam::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
tensorflow_cpp tensorflow::ops::Relu6 tensorflow::ops::Relu6
======================
`#include <nn_ops.h>`
Computes rectified linear 6: `min(max(features, 0), 6)`.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The activations tensor.
| Constructors and Destructors |
| --- |
| `[Relu6](#classtensorflow_1_1ops_1_1_relu6_1a45f621ee373041532016f560877d4480)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_relu6_1a53fc6f0eef536bbaf9e4a8f21ca781d8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_relu6_1aef99dae716b87d9aa63ccf6c78ac0d44)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_relu6_1a8f0f3d6a08f0ca2f033998a8f451620d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_relu6_1a131a74dbb3151fd75bb90a00521ae582)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_relu6_1afac4a336ddaad5d9ade1a43544937246)() const` | |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### operation
```
Operation operation
```
Public functions
----------------
### Relu6
```
Relu6(
const ::tensorflow::Scope & scope,
::tensorflow::Input features
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::RandomUniformInt tensorflow::ops::RandomUniformInt
=================================
`#include <random_ops.h>`
Outputs random integers from a uniform distribution.
Summary
-------
The generated values are uniform integers in the range `[minval, maxval)`. The lower bound `minval` is included in the range, while the upper bound `maxval` is excluded.
The random integers are slightly biased unless `maxval - minval` is an exact power of two. The bias is small for values of `maxval - minval` significantly smaller than the range of the output (either `2^32` or `2^64`).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: The shape of the output tensor.
* minval: 0-D. Inclusive lower bound on the generated integers.
* maxval: 0-D. Exclusive upper bound on the generated integers.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor of the specified shape filled with uniform random integers.
| Constructors and Destructors |
| --- |
| `[RandomUniformInt](#classtensorflow_1_1ops_1_1_random_uniform_int_1a7b0f0233dbf65c942cf3918e6d82450f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) minval, ::[tensorflow::Input](../input#classtensorflow_1_1_input) maxval)` |
| `[RandomUniformInt](#classtensorflow_1_1ops_1_1_random_uniform_int_1ae9a8b67a0592c64aeadb9c28b8c94d11)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) minval, ::[tensorflow::Input](../input#classtensorflow_1_1_input) maxval, const [RandomUniformInt::Attrs](../../../struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_random_uniform_int_1a71afc20cf5a867f5f4e616265fbdc245)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_random_uniform_int_1ac0cdf1a4f133d9b49df247840a40ff7f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_uniform_int_1a49b64e7338480155d405c8857052dba8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_uniform_int_1ab20d5478b1e7f66bec1208d955bc485f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_uniform_int_1a3a4c37bc4f79b459f17c8d6d01e4024c)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_random_uniform_int_1a62449aa6617d6d92891fbd702315d3d6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_uniform_int_1a88e15830d1509a59f35301ecfe8aee1c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-uniform-int/attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomUniformInt::Attrs](../../../struct/tensorflow/ops/random-uniform-int/attrs) | Optional attribute setters for [RandomUniformInt](random-uniform-int#classtensorflow_1_1ops_1_1_random_uniform_int). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RandomUniformInt
```
RandomUniformInt(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input minval,
::tensorflow::Input maxval
)
```
### RandomUniformInt
```
RandomUniformInt(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input minval,
::tensorflow::Input maxval,
const RandomUniformInt::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ScatterAdd tensorflow::ops::ScatterAdd
===========================
`#include <state_ops.h>`
Adds sparse updates to a variable reference.
Summary
-------
This operation computes
```
# Scalar indices
ref[indices, ...] += updates[...]
# Vector indices (for each i)
ref[indices[i], ...] += updates[i, ...]
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
```
This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.
Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions add.
Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* indices: A tensor of indices into the first dimension of `ref`.
* updates: A tensor of updated values to add to `ref`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-add/attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs)`):
* use\_locking: If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterAdd](#classtensorflow_1_1ops_1_1_scatter_add_1aebad5eb3382d85a98694a67516fb31be)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterAdd](#classtensorflow_1_1ops_1_1_scatter_add_1a784b3e2e01f007a9c99a4bed4d2a52a7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterAdd::Attrs](../../../struct/tensorflow/ops/scatter-add/attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_add_1a3f10d947b38ba138d7b4b3841a6f86e9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_add_1a10b0695ddf8f2320ea456a07d4d203b6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_add_1a1dc28df0910552341f7da76eee369656)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_add_1a038d19ab294d54a525dd26c1f4c6a44c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_add_1af3d320c18d631efb10dafef8fc14483e)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_add_1aaf4c7b793661818e64f807275f07c01e)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-add/attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterAdd::Attrs](../../../struct/tensorflow/ops/scatter-add/attrs) | Optional attribute setters for [ScatterAdd](scatter-add#classtensorflow_1_1ops_1_1_scatter_add). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterAdd
```
ScatterAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterAdd
```
ScatterAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterAdd::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::DecodeBmp tensorflow::ops::DecodeBmp
==========================
`#include <image_ops.h>`
Decode the first frame of a BMP-encoded image to a uint8 tensor.
Summary
-------
The attr `channels` indicates the desired number of color channels for the decoded image.
Accepted values are:
* 0: Use the number of channels in the BMP-encoded image.
* 3: output an RGB image.
* 4: output an RGBA image.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* contents: 0-D. The BMP-encoded image.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D with shape `[height, width, channels]`. RGB order
| Constructors and Destructors |
| --- |
| `[DecodeBmp](#classtensorflow_1_1ops_1_1_decode_bmp_1a855787daeff1be34d915da13f1558e54)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| `[DecodeBmp](#classtensorflow_1_1ops_1_1_decode_bmp_1a5d310550797ac800bdedfa5b0f952fb6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, const [DecodeBmp::Attrs](../../../struct/tensorflow/ops/decode-bmp/attrs#structtensorflow_1_1ops_1_1_decode_bmp_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[image](#classtensorflow_1_1ops_1_1_decode_bmp_1aea897d04b869d2e3914701e2d67a8fe4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_decode_bmp_1a04ba19d38081ad21624b98dfbe82f820)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_bmp_1a3cd839e2c4b2c2fb8e5a1bd9a6a0601e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_bmp_1a1797102fb2ef1291fef6911ab3dce187)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_bmp_1a1b3e3327c4b3957e8563a09b778d9b21)() const` | |
| Public static functions |
| --- |
| `[Channels](#classtensorflow_1_1ops_1_1_decode_bmp_1a5b486f770e8a02c96c14c50f0c791199)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-bmp/attrs#structtensorflow_1_1ops_1_1_decode_bmp_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodeBmp::Attrs](../../../struct/tensorflow/ops/decode-bmp/attrs) | Optional attribute setters for [DecodeBmp](decode-bmp#classtensorflow_1_1ops_1_1_decode_bmp). |
Public attributes
-----------------
### image
```
::tensorflow::Output image
```
### operation
```
Operation operation
```
Public functions
----------------
### DecodeBmp
```
DecodeBmp(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents
)
```
### DecodeBmp
```
DecodeBmp(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents,
const DecodeBmp::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Channels
```
Attrs Channels(
int64 x
)
```
tensorflow_cpp tensorflow::ops::QuantizedAvgPool tensorflow::ops::QuantizedAvgPool
=================================
`#include <nn_ops.h>`
Produces the average pool of the input tensor for quantized types.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, height, width, channels]`.
* min\_input: The float value that the lowest quantized input value represents.
* max\_input: The float value that the highest quantized input value represents.
* ksize: The size of the window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
* strides: The stride of the sliding window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
* padding: The type of padding algorithm to use.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output
* `[Output](../output#classtensorflow_1_1_output)` min\_output: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_output: The float value that the highest quantized output value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedAvgPool](#classtensorflow_1_1ops_1_1_quantized_avg_pool_1a0823ca0ce083dff45fb61cbe18b80e5e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| Public attributes |
| --- |
| `[max\_output](#classtensorflow_1_1ops_1_1_quantized_avg_pool_1a10d8a56c7b4c34bbe566ca787e2ebc87)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_output](#classtensorflow_1_1ops_1_1_quantized_avg_pool_1a6724f4314e0b43a958cf6b78bd096510)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_avg_pool_1a49a59391821a67d191168d947cd36055)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantized_avg_pool_1a117cc564ad5019e8659a3a3714cb3411)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### max\_output
```
::tensorflow::Output max_output
```
### min\_output
```
::tensorflow::Output min_output
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizedAvgPool
```
QuantizedAvgPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input min_input,
::tensorflow::Input max_input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
tensorflow_cpp tensorflow::ops::Conv3DBackpropInputV2 tensorflow::ops::Conv3DBackpropInputV2
======================================
`#include <nn_ops.h>`
Computes the gradients of 3-D convolution with respect to the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_sizes: An integer vector representing the tensor shape of `input`, where `input` is a 5-D `[batch, depth, rows, cols, in_channels]` tensor.
* filter: Shape `[depth, rows, cols, in_channels, out_channels]`. `in_channels` must match between `input` and `filter`.
* out\_backprop: Backprop signal of shape `[batch, out_depth, out_rows, out_cols, out_channels]`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-input-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
* dilations: 1-D tensor of length 5. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Conv3DBackpropInputV2](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1aaae19e097fea9d7fc6f815e20faaccd6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[Conv3DBackpropInputV2](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1a5c69778ddcd70862d70f7d3630d179c3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding, const [Conv3DBackpropInputV2::Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-input-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1a67a6ca650c6870d418f1fdd658f3fa6b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1af0d983aaf022b911e25e9f0615b62c20)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1adb36b7921921ed6c8a2684a8df5cc0ae)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1a0c617c40ac75a3540b1280f1e02147ed)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1a8b8868a10a3fac1cb6623b75a7bd556d)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1a5a0f9e531569a6645dc6eb72894476c5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-input-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1a7c96359abb43990fc21d1cf52f468a1b)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-input-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Conv3DBackpropInputV2::Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-input-v2/attrs) | Optional attribute setters for [Conv3DBackpropInputV2](conv3-d-backprop-input-v2#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conv3DBackpropInputV2
```
Conv3DBackpropInputV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_sizes,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### Conv3DBackpropInputV2
```
Conv3DBackpropInputV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_sizes,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const Conv3DBackpropInputV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ControlTrigger tensorflow::ops::ControlTrigger
===============================
`#include <control_flow_ops.h>`
Does nothing.
Summary
-------
Serves as a control trigger for scheduling.
Only useful as a placeholder for control edges.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ControlTrigger](#classtensorflow_1_1ops_1_1_control_trigger_1a9d54e681bdd8089c53e503ac63cd2894)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_control_trigger_1af3a7859538706903504df90d9933f987)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_control_trigger_1aeb98ba36e050bdd02c3ca667980887e8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ControlTrigger
```
ControlTrigger(
const ::tensorflow::Scope & scope
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::EncodeJpegVariableQuality tensorflow::ops::EncodeJpegVariableQuality
==========================================
`#include <image_ops.h>`
JPEG encode input image with provided compression quality.
Summary
-------
`image` is a 3-D uint8 [Tensor](../tensor#classtensorflow_1_1_tensor) of shape `[height, width, channels]`. `quality` is an int32 jpeg compression quality value between 0 and 100.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: Images to adjust. At least 3-D.
* quality: An int quality to encode to.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 0-D. JPEG-encoded image.
| Constructors and Destructors |
| --- |
| `[EncodeJpegVariableQuality](#classtensorflow_1_1ops_1_1_encode_jpeg_variable_quality_1a6701c2f20dcc861314b5cc0cde131522)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) quality)` |
| Public attributes |
| --- |
| `[contents](#classtensorflow_1_1ops_1_1_encode_jpeg_variable_quality_1a351ecfb22dec47b75be8ad7382ac22ba)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_encode_jpeg_variable_quality_1aa7ee9ed8914528726bbcc0989ae12f9e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_encode_jpeg_variable_quality_1aadf8b42e21af16ce89cff9e051ef7bf9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_encode_jpeg_variable_quality_1acc77cd9d93d5c78dc8298b903430765a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_encode_jpeg_variable_quality_1a259c81d5161bf89937f226ada3f3b734)() const` | |
Public attributes
-----------------
### contents
```
::tensorflow::Output contents
```
### operation
```
Operation operation
```
Public functions
----------------
### EncodeJpegVariableQuality
```
EncodeJpegVariableQuality(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input quality
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Xlogy tensorflow::ops::Xlogy
======================
`#include <math_ops.h>`
Returns 0 if x == 0, and x \* log(y) otherwise, elementwise.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Xlogy](#classtensorflow_1_1ops_1_1_xlogy_1a4b41a27e531b1a5e78acafa538f2cd6c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_xlogy_1a215e7c4bc6fd18b8a0e8ea5e9fdfecbb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_xlogy_1a972c6654578a712c68611dbc476ba33c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_xlogy_1ace82eaa66611c504e0f0a54790c73b89)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_xlogy_1aab4efccb5e7b4b5f346bfd8d1a08c0eb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_xlogy_1abc2f2a98242140d121e8821fe3d3d645)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Xlogy
```
Xlogy(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QueueDequeueUpTo tensorflow::ops::QueueDequeueUpTo
=================================
`#include <data_flow_ops.h>`
Dequeues `n` tuples of one or more tensors from the given queue.
Summary
-------
This operation is not supported by all queues. If a queue does not support DequeueUpTo, then an Unimplemented error is returned.
If the queue is closed and there are more than 0 but less than `n` elements remaining, then instead of returning an OutOfRange error like [QueueDequeueMany](queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many), less than `n` elements are returned immediately. If the queue is closed and there are 0 elements left in the queue, then an OutOfRange error is returned just like in [QueueDequeueMany](queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many). Otherwise the behavior is identical to [QueueDequeueMany](queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many):
This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. [All](all#classtensorflow_1_1ops_1_1_all) of the components in the dequeued tuple will have size n in the 0th dimension.
This operation has `k` outputs, where `k` is the number of components in the tuples stored in the given queue, and output `i` is the ith component of the dequeued tuple.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
* n: The number of tuples to dequeue.
* component\_types: The type of each component in a tuple.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/queue-dequeue-up-to/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs)`):
* timeout\_ms: If the queue has fewer than n elements, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet.
Returns:
* `OutputList`: One or more tensors that were dequeued as a tuple.
| Constructors and Destructors |
| --- |
| `[QueueDequeueUpTo](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1aca97813734e5ee8336249c2d1cee8630)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) n, const DataTypeSlice & component_types)` |
| `[QueueDequeueUpTo](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a6e43ee993ab5a91d42cf6bb2ae59a53f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) n, const DataTypeSlice & component_types, const [QueueDequeueUpTo::Attrs](../../../struct/tensorflow/ops/queue-dequeue-up-to/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[components](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a0679388d38032e4520a34428aeae1a31)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a20f6d60f9d0837a67db6bd29d2078fad)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a30cf1d991c2f78f4edb53783d1bda37e)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[TimeoutMs](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a5a0258537ccd1cc274cd984b6f97a364)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/queue-dequeue-up-to/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QueueDequeueUpTo::Attrs](../../../struct/tensorflow/ops/queue-dequeue-up-to/attrs) | Optional attribute setters for [QueueDequeueUpTo](queue-dequeue-up-to#classtensorflow_1_1ops_1_1_queue_dequeue_up_to). |
Public attributes
-----------------
### components
```
::tensorflow::OutputList components
```
### operation
```
Operation operation
```
Public functions
----------------
### QueueDequeueUpTo
```
QueueDequeueUpTo(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input n,
const DataTypeSlice & component_types
)
```
### QueueDequeueUpTo
```
QueueDequeueUpTo(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input n,
const DataTypeSlice & component_types,
const QueueDequeueUpTo::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### TimeoutMs
```
Attrs TimeoutMs(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ExtractVolumePatches tensorflow::ops::ExtractVolumePatches
=====================================
`#include <array_ops.h>`
Extract `patches` from `input` and put them in the `"depth"` output dimension.
Summary
-------
3D extension of `extract_image_patches`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 5-D [Tensor](../tensor#classtensorflow_1_1_tensor) with shape `[batch, in_planes, in_rows, in_cols, depth]`.
* ksizes: The size of the sliding window for each dimension of `input`.
* strides: 1-D of length 5. How far the centers of two consecutive patches are in `input`. Must be: `[1, stride_planes, stride_rows, stride_cols, 1]`.
* padding: The type of padding algorithm to use.
The size-related attributes are specified as follows:
```
ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
strides = [1, stride_planes, strides_rows, strides_cols, 1]
```
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 5-D [Tensor](../tensor#classtensorflow_1_1_tensor) with shape `[batch, out_planes, out_rows, out_cols, ksize_planes * ksize_rows * ksize_cols * depth]` containing patches with size `ksize_planes x ksize_rows x ksize_cols x depth` vectorized in the "depth" dimension. Note `out_planes`, `out_rows` and `out_cols` are the dimensions of the output patches.
| Constructors and Destructors |
| --- |
| `[ExtractVolumePatches](#classtensorflow_1_1ops_1_1_extract_volume_patches_1a752dba9a13577efb227d68e11e73e4e7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksizes, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_extract_volume_patches_1ab7a74fc2dc2e90c7c44399f5673a6664)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[patches](#classtensorflow_1_1ops_1_1_extract_volume_patches_1a88a4e306f94549ed420d3e6770bf7bbc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_extract_volume_patches_1ad156203fcbe558f0a53b6c0b7f34c016)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_extract_volume_patches_1ad316cf0f924cac92315f835a66c577f8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_extract_volume_patches_1a6ff00c0c8df929a77bf90a0258d87a88)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### patches
```
::tensorflow::Output patches
```
Public functions
----------------
### ExtractVolumePatches
```
ExtractVolumePatches(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksizes,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::BarrierIncompleteSize tensorflow::ops::BarrierIncompleteSize
======================================
`#include <data_flow_ops.h>`
Computes the number of incomplete elements in the given barrier.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a barrier.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The number of incomplete elements (i.e. those with some of their value components not set) in the barrier.
| Constructors and Destructors |
| --- |
| `[BarrierIncompleteSize](#classtensorflow_1_1ops_1_1_barrier_incomplete_size_1aae0ce9b883a397fd5866d8d8fe40ac5c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_barrier_incomplete_size_1a0efa875ea12db3a40f4ac1cd46693292)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_barrier_incomplete_size_1a402b71e4355afa3e2dcbe8aaf0b1e480)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_barrier_incomplete_size_1a2c41002f6e148fd17ba8a469d0b4173a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_barrier_incomplete_size_1ad72344e5b81b50744987e96dbd8928bc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_barrier_incomplete_size_1a18b15fab96a5dfc2940adaf40a3d39c2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### BarrierIncompleteSize
```
BarrierIncompleteSize(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseApplyRMSProp tensorflow::ops::SparseApplyRMSProp
===================================
`#include <training_ops.h>`
Update '\*var' according to the RMSProp algorithm.
Summary
-------
Note that in dense implementation of this algorithm, ms and mom will update even if the grad is zero, but in this sparse implementation, ms and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon)
$$ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad$$ $$mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms + epsilon)$$ $$var <- var - mom$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var, ms and mom.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyRMSProp](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1a294b9022369ff505c3a86a061d7e1e89)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[SparseApplyRMSProp](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1ae7e1961797bdee0ed9c2e05e0c6f5b9a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [SparseApplyRMSProp::Attrs](../../../struct/tensorflow/ops/sparse-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1a47820b04ad723a34e536357b737fd52a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1a52eae17378a3e495459e1228a85231f1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1aaaa68f0bf1d1ae0d39baabfb6cf7e914)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1a3332860de74905325de2385e61f1bf1b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1afa85184aa4b370ef02ba3659b7183a1a)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1a0cf09326834a568a3c1cad7cf91129e1)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyRMSProp::Attrs](../../../struct/tensorflow/ops/sparse-apply-r-m-s-prop/attrs) | Optional attribute setters for [SparseApplyRMSProp](sparse-apply-r-m-s-prop#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyRMSProp
```
SparseApplyRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### SparseApplyRMSProp
```
SparseApplyRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices,
const SparseApplyRMSProp::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::UnsortedSegmentSum tensorflow::ops::UnsortedSegmentSum
===================================
`#include <math_ops.h>`
Computes the sum along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Computes a tensor such that \(output[i] = \sum\_{j...} data[j...]\) where the sum is over tuples `j...` such that `segment_ids[j...] == i`. Unlike `[SegmentSum](segment-sum#classtensorflow_1_1ops_1_1_segment_sum)`, `segment_ids` need not be sorted and need not cover all values in the full range of valid values.
If the sum is empty for a given segment ID `i`, `output[i] = 0`. If the given segment ID `i` is negative, the value is dropped and will not be added to the sum of the segment.
`num_segments` should equal the number of distinct segment IDs.
Caution: On CPU, values in `segment_ids` are always validated to be less than `num_segments`, and an error is thrown for out-of-bound indices. On GPU, this does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices result in safe but unspecified behavior, which may include ignoring out-of-bound indices or outputting a tensor with a 0 stored in the first dimension of its shape if `num_segments` is 0.

c = [[1,2,3,4], [5,6,7,8], [4,3,2,1]] tf.math.unsorted\_segment\_sum(c, [0, 1, 0], num\_segments=2).numpy() array([[5, 5, 5, 5], [5, 6, 7, 8]], dtype=int32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A tensor whose shape is a prefix of `data.shape`. The values must be less than `num_segments`.
Caution: The values are always validated to be in range on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for the first `segment_ids.rank` dimensions, which are replaced with a single dimension which has size `num_segments`.
| Constructors and Destructors |
| --- |
| `[UnsortedSegmentSum](#classtensorflow_1_1ops_1_1_unsorted_segment_sum_1a523a2af71c68956739def8e73da562ce)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_unsorted_segment_sum_1abea8a0230165d39d5462f3b026641a87)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_unsorted_segment_sum_1ace1d27d6d7cc362c688e1a08ea92c40f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_unsorted_segment_sum_1aeb60f49f613fc351fc9cc30a55a66486)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unsorted_segment_sum_1a11030ed77273925e7bbdf6ba24defdd9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unsorted_segment_sum_1ac3c5ac1a7b8d9c7b5047dff05040dff1)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### UnsortedSegmentSum
```
UnsortedSegmentSum(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizedBiasAdd tensorflow::ops::QuantizedBiasAdd
=================================
`#include <nn_ops.h>`
Adds [Tensor](../tensor#classtensorflow_1_1_tensor) 'bias' to [Tensor](../tensor#classtensorflow_1_1_tensor) 'input' for Quantized types.
Summary
-------
Broadcasts the values of bias on dimensions 0..N-2 of 'input'.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* bias: A 1D bias [Tensor](../tensor#classtensorflow_1_1_tensor) with size matching the last dimension of 'input'.
* min\_input: The float value that the lowest quantized input value represents.
* max\_input: The float value that the highest quantized input value represents.
* min\_bias: The float value that the lowest quantized bias value represents.
* max\_bias: The float value that the highest quantized bias value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output
* `[Output](../output#classtensorflow_1_1_output)` min\_out: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_out: The float value that the highest quantized output value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedBiasAdd](#classtensorflow_1_1ops_1_1_quantized_bias_add_1a714d25955616f4da492f9171af26e2d1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bias, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_bias, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_bias, DataType out_type)` |
| Public attributes |
| --- |
| `[max\_out](#classtensorflow_1_1ops_1_1_quantized_bias_add_1a3d2e3fabd5ec3ef887d0a530cb512976)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_out](#classtensorflow_1_1ops_1_1_quantized_bias_add_1a7676ea75bc57b79bb7701317f4113665)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_bias_add_1a889d868db5e6022ccf39d06a085a1c44)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantized_bias_add_1a2a310917f0ff87e61c378f4b12406c2f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### max\_out
```
::tensorflow::Output max_out
```
### min\_out
```
::tensorflow::Output min_out
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizedBiasAdd
```
QuantizedBiasAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input bias,
::tensorflow::Input min_input,
::tensorflow::Input max_input,
::tensorflow::Input min_bias,
::tensorflow::Input max_bias,
DataType out_type
)
```
tensorflow_cpp tensorflow::ops::QuantizedMatMul tensorflow::ops::QuantizedMatMul
================================
`#include <math_ops.h>`
Perform a quantized matrix multiplication of `a` by the matrix `b`.
Summary
-------
The inputs must be two-dimensional matrices and the inner dimension of `a` (after being transposed if `transpose_a` is non-zero) must match the outer dimension of `b` (after being transposed if `transposed_b` is non-zero).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* a: Must be a two-dimensional tensor.
* b: Must be a two-dimensional tensor.
* min\_a: The float value that the lowest quantized `a` value represents.
* max\_a: The float value that the highest quantized `a` value represents.
* min\_b: The float value that the lowest quantized `b` value represents.
* max\_b: The float value that the highest quantized `b` value represents.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)`):
* transpose\_a: If true, `a` is transposed before multiplication.
* transpose\_b: If true, `b` is transposed before multiplication.
* Tactivation: The type of output produced by activation function following this operation.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` out
* `[Output](../output#classtensorflow_1_1_output)` min\_out: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_out: The float value that the highest quantized output value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedMatMul](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1a0f09b0e35ddc6a6324c65db6ec69a731)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_b, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_b)` |
| `[QuantizedMatMul](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1a882f02d4d46fa0c4ddb44a2e201929dc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_b, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_b, const [QuantizedMatMul::Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[max\_out](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1ad70908bf74ce2c40aa1f778693c60d8f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_out](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1a8dfe353eb1695a006f27c2cd8210b728)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1ad9abd5818d18e9d7f03c3db5ef1464ff)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1a891101c5425593a778947c2a3019d4a3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Tactivation](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1adf046668cb84feff06bb62ac8dfe9cb9)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` |
| `[Toutput](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1ab91328f7f63e496fbf14e3f2a7ca46fe)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` |
| `[TransposeA](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1afbe2add319dc39e1db4dc583f556def9)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` |
| `[TransposeB](#classtensorflow_1_1ops_1_1_quantized_mat_mul_1a6525a94155917583356eb70dd02f1f72)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedMatMul::Attrs](../../../struct/tensorflow/ops/quantized-mat-mul/attrs) | Optional attribute setters for [QuantizedMatMul](quantized-mat-mul#classtensorflow_1_1ops_1_1_quantized_mat_mul). |
Public attributes
-----------------
### max\_out
```
::tensorflow::Output max_out
```
### min\_out
```
::tensorflow::Output min_out
```
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### QuantizedMatMul
```
QuantizedMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b,
::tensorflow::Input min_a,
::tensorflow::Input max_a,
::tensorflow::Input min_b,
::tensorflow::Input max_b
)
```
### QuantizedMatMul
```
QuantizedMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b,
::tensorflow::Input min_a,
::tensorflow::Input max_a,
::tensorflow::Input min_b,
::tensorflow::Input max_b,
const QuantizedMatMul::Attrs & attrs
)
```
Public static functions
-----------------------
### Tactivation
```
Attrs Tactivation(
DataType x
)
```
### Toutput
```
Attrs Toutput(
DataType x
)
```
### TransposeA
```
Attrs TransposeA(
bool x
)
```
### TransposeB
```
Attrs TransposeB(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseAdd tensorflow::ops::SparseAdd
==========================
`#include <sparse_ops.h>`
Adds two `SparseTensor` objects to produce another `SparseTensor`.
Summary
-------
The input `SparseTensor` objects' indices are assumed ordered in standard lexicographic order. If this is not the case, before this step run `[SparseReorder](sparse-reorder#classtensorflow_1_1ops_1_1_sparse_reorder)` to restore index ordering.
By default, if two values sum to zero at some index, the output `SparseTensor` would still include that particular location in its index, storing a zero in the corresponding value slot. To override this, callers can specify `thresh`, indicating that if the sum has a magnitude strictly smaller than `thresh`, its corresponding value and index would then not be included. In particular, `thresh == 0` (default) means everything is kept and actual thresholding happens only for a positive value.
In the following shapes, `nnz` is the count after taking `thresh` into account.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* a\_indices: 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix.
* a\_values: 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector.
* a\_shape: 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector.
* b\_indices: 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix.
* b\_values: 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector.
* b\_shape: 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector.
* thresh: 0-D. The magnitude threshold that determines if an output value/index pair takes space.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sum\_indices
* `[Output](../output#classtensorflow_1_1_output)` sum\_values
* `[Output](../output#classtensorflow_1_1_output)` sum\_shape
| Constructors and Destructors |
| --- |
| `[SparseAdd](#classtensorflow_1_1ops_1_1_sparse_add_1a07c65af8c10333ec7605e9a7f0a1be2b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) thresh)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_add_1aab871539035af62dcf3df695fc396ba0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sum\_indices](#classtensorflow_1_1ops_1_1_sparse_add_1a935595157260ea9fcff05da3c0341947)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sum\_shape](#classtensorflow_1_1ops_1_1_sparse_add_1a573a3dbb573b8d6fb0172ca669d4685f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sum\_values](#classtensorflow_1_1ops_1_1_sparse_add_1a2cc06856b4695dd0ba3ea4f686160ddf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### sum\_indices
```
::tensorflow::Output sum_indices
```
### sum\_shape
```
::tensorflow::Output sum_shape
```
### sum\_values
```
::tensorflow::Output sum_values
```
Public functions
----------------
### SparseAdd
```
SparseAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input a_indices,
::tensorflow::Input a_values,
::tensorflow::Input a_shape,
::tensorflow::Input b_indices,
::tensorflow::Input b_values,
::tensorflow::Input b_shape,
::tensorflow::Input thresh
)
```
tensorflow_cpp tensorflow::ops::CropAndResizeGradImage tensorflow::ops::CropAndResizeGradImage
=======================================
`#include <image_ops.h>`
Computes the gradient of the crop\_and\_resize op wrt the input image tensor.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* grads: A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`.
* boxes: A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor specifies the coordinates of a box in the `box_ind[i]` image and is specified in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the `[0, 1]` interval of normalized image height is mapped to `[0, image\_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the `[0, 1]` range are allowed, in which case we use `extrapolation_value` to extrapolate the input image values.
* box\_ind: A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. The value of `box_ind[i]` specifies the image that the `i`-th box refers to.
* image\_size: A 1-D tensor with value `[batch, image_height, image_width, depth]` containing the original image size. Both `image_height` and `image_width` need to be positive.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-image/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1_1_attrs)`):
* method: A string specifying the interpolation method. Only 'bilinear' is supported for now.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 4-D tensor of shape `[batch, image_height, image_width, depth]`.
| Constructors and Destructors |
| --- |
| `[CropAndResizeGradImage](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1a542871b76c83a2a8ae095c5ade81ab0e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grads, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) box_ind, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, DataType T)` |
| `[CropAndResizeGradImage](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1a5314c519439a0018be03ae0599c320d3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grads, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) box_ind, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, DataType T, const [CropAndResizeGradImage::Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-image/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1ad757af122f700a9ab5acbd38629f83fb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1adc227b21eb0d9d4ca672f34f67b7943d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1a614b37524e5b31e34837f59518d54830)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1a561ea8804d44d30b5d50d84b6619a89c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1a189d45da47ace193a132f998417286d2)() const` | |
| Public static functions |
| --- |
| `[Method](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1a10a7af8fef715e541d4c1c1472871fa5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-image/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::CropAndResizeGradImage::Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-image/attrs) | Optional attribute setters for [CropAndResizeGradImage](crop-and-resize-grad-image#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### CropAndResizeGradImage
```
CropAndResizeGradImage(
const ::tensorflow::Scope & scope,
::tensorflow::Input grads,
::tensorflow::Input boxes,
::tensorflow::Input box_ind,
::tensorflow::Input image_size,
DataType T
)
```
### CropAndResizeGradImage
```
CropAndResizeGradImage(
const ::tensorflow::Scope & scope,
::tensorflow::Input grads,
::tensorflow::Input boxes,
::tensorflow::Input box_ind,
::tensorflow::Input image_size,
DataType T,
const CropAndResizeGradImage::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Method
```
Attrs Method(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::RegexFullMatch tensorflow::ops::RegexFullMatch
===============================
`#include <string_ops.h>`
Check if the input matches the regex pattern.
Summary
-------
The input is a string tensor of any shape. The pattern is a scalar string tensor which is applied to every element of the input tensor. The boolean values (True or False) of the output tensor indicate if the input matches the regex pattern provided.
The pattern follows the re2 syntax (<https://github.com/google/re2/wiki/Syntax>)
Examples:
tf.strings.regex\_full\_match(["TF lib", "lib TF"], ".\*lib$") tf.strings.regex\_full\_match(["TF lib", "lib TF"], ".\*TF$")
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A string tensor of the text to be processed.
* pattern: A scalar string tensor containing the regular expression to match the input.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A bool tensor with the same shape as `input`.
| Constructors and Destructors |
| --- |
| `[RegexFullMatch](#classtensorflow_1_1ops_1_1_regex_full_match_1a9aabe9286270dc27b6fd82316259b98e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pattern)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_regex_full_match_1a42931e9f1b9b6a6bcf35282d06977871)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_regex_full_match_1a2347cdeb355a1b911773cfbabbffd8b8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_regex_full_match_1a736ef64245d191a4ff7e4c67d8e655bd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_regex_full_match_1a1b4546c550f423ff22828fc63e04ae23)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_regex_full_match_1a3552df1d0b65b824e61669da96bf8f10)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RegexFullMatch
```
RegexFullMatch(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input pattern
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseReduceMax tensorflow::ops::SparseReduceMax
================================
`#include <sparse_ops.h>`
Computes the max of elements across dimensions of a SparseTensor.
Summary
-------
This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_max()`. In particular, this Op also returns a dense `[Tensor](../tensor#classtensorflow_1_1_tensor)` instead of a sparse one.
Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
If `reduction_axes` has no entries, all dimensions are reduced, and a tensor with a single element is returned. Additionally, the axes can be negative, which are interpreted according to the indexing rules in Python.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* input\_values: 1-D. `N` non-empty values corresponding to `input_indices`.
* input\_shape: 1-D. Shape of the input SparseTensor.
* reduction\_axes: 1-D. Length-`K` vector containing the reduction axes.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: `R-K`-D. The reduced [Tensor](../tensor#classtensorflow_1_1_tensor).
| Constructors and Destructors |
| --- |
| `[SparseReduceMax](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1aeae496cfc74e42b24882c7d5148b23e0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes)` |
| `[SparseReduceMax](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a451a0e2215cd3d4e69813f5405ae454f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes, const [SparseReduceMax::Attrs](../../../struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a90126f27d38e5eddd6614a6f5330b139)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1ada3c0765be81f44a13f068c10a43cb34)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a886a875c7b1cfc9b2f69ce45239582c3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a99bf4a11aed55ac04ed9aadfe5f3c8f9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a6687bcf1dca9bdb8019f8fcf46c00a17)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1adc6b4f1a804b4ca85bc40b2a677288ae)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseReduceMax::Attrs](../../../struct/tensorflow/ops/sparse-reduce-max/attrs) | Optional attribute setters for [SparseReduceMax](sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseReduceMax
```
SparseReduceMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes
)
```
### SparseReduceMax
```
SparseReduceMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes,
const SparseReduceMax::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyMomentum tensorflow::ops::ResourceSparseApplyMomentum
============================================
`#include <training_ops.h>`
Update relevant entries in '\*var' and '\*accum' according to the momentum scheme.
Summary
-------
Set use\_nesterov = True if you want to use Nesterov momentum.
That is for rows we have grad for, we update var and accum as follows:
accum = accum \* momentum + grad var -= lr \* accum
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* momentum: Momentum. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyMomentum](#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1a3b89e9c66e4d0dc308a10134ae6cbebf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum)` |
| `[ResourceSparseApplyMomentum](#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1a7bfac1b224e032491ecc86795f329c8e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, const [ResourceSparseApplyMomentum::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1a11426b87c209f56e6dcf2292d88add6b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1afbbbd2135b89a2e0cb965142a19a3aaa)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1a4c78145c5e8b7aa22178f1a4d57812ac)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1a433bc4ac6cba2fdad7e05889843770e4)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyMomentum::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-momentum/attrs) | Optional attribute setters for [ResourceSparseApplyMomentum](resource-sparse-apply-momentum#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyMomentum
```
ResourceSparseApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input momentum
)
```
### ResourceSparseApplyMomentum
```
ResourceSparseApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input momentum,
const ResourceSparseApplyMomentum::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
tensorflow_cpp tensorflow::ops::GuaranteeConst tensorflow::ops::GuaranteeConst
===============================
`#include <array_ops.h>`
Gives a guarantee to the TF runtime that the input tensor is a constant.
Summary
-------
The runtime is then free to make optimizations based on this.
Only accepts value typed tensors as inputs and rejects resource variable handles as input.
Returns the input tensor without modification.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[GuaranteeConst](#classtensorflow_1_1ops_1_1_guarantee_const_1aecb7186521992db83d5ca625a67922db)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_guarantee_const_1a1a8622d1bba372774a431c39393b7e38)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_guarantee_const_1a27746912bbdc11f993cfa01346811693)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_guarantee_const_1acc70f6644738d60162d522b63d03022a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_guarantee_const_1a5293cfbc228fadedc0e21bc36385d263)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_guarantee_const_1a72efaf63dbaa36a174de160a775dc517)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### GuaranteeConst
```
GuaranteeConst(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::CropAndResizeGradBoxes tensorflow::ops::CropAndResizeGradBoxes
=======================================
`#include <image_ops.h>`
Computes the gradient of the crop\_and\_resize op wrt the input boxes tensor.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* grads: A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`.
* image: A 4-D tensor of shape `[batch, image_height, image_width, depth]`. Both `image_height` and `image_width` need to be positive.
* boxes: A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor specifies the coordinates of a box in the `box_ind[i]` image and is specified in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the `[0, 1]` interval of normalized image height is mapped to `[0, image\_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the `[0, 1]` range are allowed, in which case we use `extrapolation_value` to extrapolate the input image values.
* box\_ind: A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. The value of `box_ind[i]` specifies the image that the `i`-th box refers to.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-boxes/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1_1_attrs)`):
* method: A string specifying the interpolation method. Only 'bilinear' is supported for now.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 2-D tensor of shape `[num_boxes, 4]`.
| Constructors and Destructors |
| --- |
| `[CropAndResizeGradBoxes](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1a7396286fdb983072f2291a1b8e42dd72)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grads, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) box_ind)` |
| `[CropAndResizeGradBoxes](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1acb0082fa9451e89cacb7f33ec41ea71f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grads, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) box_ind, const [CropAndResizeGradBoxes::Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-boxes/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1adaf9854fc96b856511f2dc5d98f970d9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1aa787d871d3d2a6d4db396a999df47866)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1adc2ba9c9ad9db25b155a2c4d257cf17b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1a31b45934d809d1528e55f1b32e7c4a42)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1aaffb6597bcce6544556871610729fbf6)() const` | |
| Public static functions |
| --- |
| `[Method](#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1a40631e53f11d856a516a8a73adce1646)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-boxes/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::CropAndResizeGradBoxes::Attrs](../../../struct/tensorflow/ops/crop-and-resize-grad-boxes/attrs) | Optional attribute setters for [CropAndResizeGradBoxes](crop-and-resize-grad-boxes#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### CropAndResizeGradBoxes
```
CropAndResizeGradBoxes(
const ::tensorflow::Scope & scope,
::tensorflow::Input grads,
::tensorflow::Input image,
::tensorflow::Input boxes,
::tensorflow::Input box_ind
)
```
### CropAndResizeGradBoxes
```
CropAndResizeGradBoxes(
const ::tensorflow::Scope & scope,
::tensorflow::Input grads,
::tensorflow::Input image,
::tensorflow::Input boxes,
::tensorflow::Input box_ind,
const CropAndResizeGradBoxes::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Method
```
Attrs Method(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResourceScatterNdMax tensorflow::ops::ResourceScatterNdMax
=====================================
`#include <state_ops.h>`
TODO: add doc.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A resource handle. Must be from a VarHandleOp.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of values whose element wise max is taken with ref
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-max/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_max_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceScatterNdMax](#classtensorflow_1_1ops_1_1_resource_scatter_nd_max_1a08b810f508e2d643867420738133c6d7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ResourceScatterNdMax](#classtensorflow_1_1ops_1_1_resource_scatter_nd_max_1a61e41c7683c00e7078ba1734a165d82b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ResourceScatterNdMax::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-max/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_max_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_max_1a7a4225624594396741eb1b2693541520)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_max_1a367a16df68d578414d8f78694cbbc9f8)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_scatter_nd_max_1a180f16ef67806bf2993d5c5ba2b2f82e)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-max/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_max_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceScatterNdMax::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-max/attrs) | Optional attribute setters for [ResourceScatterNdMax](resource-scatter-nd-max#classtensorflow_1_1ops_1_1_resource_scatter_nd_max). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceScatterNdMax
```
ResourceScatterNdMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ResourceScatterNdMax
```
ResourceScatterNdMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ResourceScatterNdMax::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Zeta tensorflow::ops::Zeta
=====================
`#include <math_ops.h>`
Compute the Hurwitz zeta function \(\zeta(x, q)\).
Summary
-------
The Hurwitz zeta function is defined as:
\(\zeta(x, q) = \sum\_{n=0}^{\infty} (q + n)^{-x}\)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Zeta](#classtensorflow_1_1ops_1_1_zeta_1a4f51c93d0f78b32bc8540a2ebcaaab5d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) q)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_zeta_1aba4a234512cab603218b2928f6f42cd5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_zeta_1af8841369fe5068a94470fce114df552c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_zeta_1a894ff1eafc095e8886ad436121b9ec4c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_zeta_1a9bfc20dc0562b9239bb0b409d6fafb95)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_zeta_1a499fde837d5d9e996479dea052f132af)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Zeta
```
Zeta(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input q
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MatMul tensorflow::ops::MatMul
=======================
`#include <math_ops.h>`
[Multiply](multiply#classtensorflow_1_1ops_1_1_multiply) the matrix "a" by the matrix "b".
Summary
-------
The inputs must be two-dimensional matrices and the inner dimension of "a" (after being transposed if transpose\_a is true) must match the outer dimension of "b" (after being transposed if transposed\_b is true).
*Note*: The default kernel implementation for [MatMul](mat-mul#classtensorflow_1_1ops_1_1_mat_mul) on GPUs uses cublas.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)`):
* transpose\_a: If true, "a" is transposed before multiplication.
* transpose\_b: If true, "b" is transposed before multiplication.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The product tensor.
| Constructors and Destructors |
| --- |
| `[MatMul](#classtensorflow_1_1ops_1_1_mat_mul_1ab83040fb6ae9e56138c0f69b00760209)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b)` |
| `[MatMul](#classtensorflow_1_1ops_1_1_mat_mul_1a34177e68c8f4fa1f1813814ce67d891c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b, const [MatMul::Attrs](../../../struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_mat_mul_1ab873d083b82c9aa9485a303d40b97eb4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[product](#classtensorflow_1_1ops_1_1_mat_mul_1ab034be60cd7ec86407eb741bdfc5f379)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_mat_mul_1a0336cd912c0b25144c3d9b57a626debf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mat_mul_1abd3e6b08fb374614d203378c1dfaec97)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mat_mul_1a9882a2914eeb6bb488bf990e3240f05a)() const` | |
| Public static functions |
| --- |
| `[TransposeA](#classtensorflow_1_1ops_1_1_mat_mul_1adde997ec4038167a5e5e31ad805e2651)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)` |
| `[TransposeB](#classtensorflow_1_1ops_1_1_mat_mul_1a94996492e8e4ff12164accf93c28dabd)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MatMul::Attrs](../../../struct/tensorflow/ops/mat-mul/attrs) | Optional attribute setters for [MatMul](mat-mul#classtensorflow_1_1ops_1_1_mat_mul). |
Public attributes
-----------------
### operation
```
Operation operation
```
### product
```
::tensorflow::Output product
```
Public functions
----------------
### MatMul
```
MatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b
)
```
### MatMul
```
MatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b,
const MatMul::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### TransposeA
```
Attrs TransposeA(
bool x
)
```
### TransposeB
```
Attrs TransposeB(
bool x
)
```
tensorflow_cpp tensorflow::ops::Conv3DBackpropFilterV2 tensorflow::ops::Conv3DBackpropFilterV2
=======================================
`#include <nn_ops.h>`
Computes the gradients of 3-D convolution with respect to the filter.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Shape `[batch, depth, rows, cols, in_channels]`.
* filter\_sizes: An integer vector representing the tensor shape of `filter`, where `filter` is a 5-D `[filter_depth, filter_height, filter_width, in_channels, out_channels]` tensor.
* out\_backprop: Backprop signal of shape `[batch, out_depth, out_rows, out_cols, out_channels]`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-filter-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
* dilations: 1-D tensor of length 5. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Conv3DBackpropFilterV2](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a694ef8c8043c259c1c99aef255d72869)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[Conv3DBackpropFilterV2](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a0e09f53b51c787856ce6a971679721bb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding, const [Conv3DBackpropFilterV2::Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-filter-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1ae093c45fec1912e7a7416513581a72a5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a16fe3a472dbf075692b0235069b595a7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a139c5f27a452c8fc21cea8d91aa9f38f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a62b211b7f77639472c845fda010fe5fb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a6848e11df31f9b03c3567c5a969290fc)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a5fdada0d12a9197a2807356a68a6a42c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-filter-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1a00a08e7b665f96c4a5e9996c1e6dad2b)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-filter-v2/attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Conv3DBackpropFilterV2::Attrs](../../../struct/tensorflow/ops/conv3-d-backprop-filter-v2/attrs) | Optional attribute setters for [Conv3DBackpropFilterV2](conv3-d-backprop-filter-v2#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conv3DBackpropFilterV2
```
Conv3DBackpropFilterV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter_sizes,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### Conv3DBackpropFilterV2
```
Conv3DBackpropFilterV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter_sizes,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const Conv3DBackpropFilterV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
tensorflow_cpp tensorflow::ops::InplaceUpdate tensorflow::ops::InplaceUpdate
==============================
`#include <array_ops.h>`
Updates specified rows 'i' with values 'v'.
Summary
-------
Computes `x[i, :] = v; return x`.
Originally this function is mutative however for compilation we make this operation create / operate on a copy of `x`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A tensor of type `T`.
* i: A vector. Indices into the left-most dimension of `x`.
* v: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`.
| Constructors and Destructors |
| --- |
| `[InplaceUpdate](#classtensorflow_1_1ops_1_1_inplace_update_1a61fe27a3358ffab9492ce7bfc2042de1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) i, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_inplace_update_1a91189ac8c186d4220acb877550f734f2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_inplace_update_1aa179189c713747eac0e48c9e63fcc143)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_inplace_update_1a70386af06c7715d224f82022915de138)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_inplace_update_1a04ab1445ae7b42549a58ffa9ebf5699a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_inplace_update_1acc127f3b9cf898b32b2c1fd0ab8da6d3)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### InplaceUpdate
```
InplaceUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input i,
::tensorflow::Input v
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::PriorityQueue tensorflow::ops::PriorityQueue
==============================
`#include <data_flow_ops.h>`
A queue that produces elements sorted by the first component value.
Summary
-------
Note that the [PriorityQueue](priority-queue#classtensorflow_1_1ops_1_1_priority_queue) requires the first component of any element to be a scalar int64, in addition to the other elements declared by component\_types. Therefore calls to Enqueue and EnqueueMany (resp. Dequeue and DequeueMany) on a [PriorityQueue](priority-queue#classtensorflow_1_1ops_1_1_priority_queue) will all require (resp. output) one extra entry in their input (resp. output) lists.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shapes: The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/priority-queue/attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)`):
* component\_types: The type of each component in a value.
* capacity: The upper bound on the number of elements in this queue. Negative numbers mean no limit.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this queue will be shared under the given name across multiple sessions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to the queue.
| Constructors and Destructors |
| --- |
| `[PriorityQueue](#classtensorflow_1_1ops_1_1_priority_queue_1a48d6f04225414471ca632c2c2f7fa61f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const gtl::ArraySlice< PartialTensorShape > & shapes)` |
| `[PriorityQueue](#classtensorflow_1_1ops_1_1_priority_queue_1a077fbbd3ddd4d6bfcc097cd3cc1b6707)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const gtl::ArraySlice< PartialTensorShape > & shapes, const [PriorityQueue::Attrs](../../../struct/tensorflow/ops/priority-queue/attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_priority_queue_1a7c9339da7e19f49ed3ba718fa3abbc03)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_priority_queue_1a5117c5ab1c0164f94212f42c9d5e7e2e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_priority_queue_1a1106c32e99fdb703d51f0ec5bc64bb14)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_priority_queue_1a7370046bb9ab89339a4cf36af96a2587)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_priority_queue_1a208f5da928335dc25e8cf5305a5de879)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_priority_queue_1a309e1701f67df0908bd467ef311b9a89)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/priority-queue/attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` |
| `[ComponentTypes](#classtensorflow_1_1ops_1_1_priority_queue_1a4bf430a0014584ae607d39e9baf2bec2)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/priority-queue/attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_priority_queue_1aed5d6a8c02b6008dbc0bbd5244966901)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/priority-queue/attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_priority_queue_1a27e53635a6e2a4732caef1194ed237b8)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/priority-queue/attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::PriorityQueue::Attrs](../../../struct/tensorflow/ops/priority-queue/attrs) | Optional attribute setters for [PriorityQueue](priority-queue#classtensorflow_1_1ops_1_1_priority_queue). |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### PriorityQueue
```
PriorityQueue(
const ::tensorflow::Scope & scope,
const gtl::ArraySlice< PartialTensorShape > & shapes
)
```
### PriorityQueue
```
PriorityQueue(
const ::tensorflow::Scope & scope,
const gtl::ArraySlice< PartialTensorShape > & shapes,
const PriorityQueue::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### ComponentTypes
```
Attrs ComponentTypes(
const DataTypeSlice & x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Tanh tensorflow::ops::Tanh
=====================
`#include <math_ops.h>`
Computes hyperbolic tangent of `x` element-wise.
Summary
-------
Given an input tensor, this function computes hyperbolic tangent of every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `[-inf, inf]` and output range is `[-1,1]`.
x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) tf.math.tanh(x)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Tanh](#classtensorflow_1_1ops_1_1_tanh_1aea689af8069ad5aa167a5d5c68f08d00)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tanh_1a96bcd29aed7f5a46bd53ba63707f18b0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_tanh_1ad67c6b0b45d43a03ca60606659597e47)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tanh_1a0ed3af7c2b72f635d4e115e655168847)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tanh_1a9e29b66924d50ec358f706f51380716a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tanh_1ae55795b9e74ab4af50d57c379232e5a6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Tanh
```
Tanh(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AddManySparseToTensorsMap tensorflow::ops::AddManySparseToTensorsMap
==========================================
`#include <sparse_ops.h>`
[Add](add#classtensorflow_1_1ops_1_1_add) an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles.
Summary
-------
A `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`, `sparse_values`, and `sparse_shape`, where
```sparse\_indices.shape[1] == sparse\_shape.shape[0] == R
```
An N-minibatch of SparseTensor objects is represented as a SparseTensor
having a first sparse_indices column taking values between [0, N), where
the minibatch size N == sparse_shape[0].
```
```
The input SparseTensor must have rank R greater than 1, and the first
dimension is treated as the minibatch dimension. Elements of the SparseTensor
must be sorted in increasing order of this first dimension. The stored
SparseTensor objects pointed to by each row of the output sparse_handles
will have rank R-1.
```
```
The SparseTensor values can then be read out as part of a minibatch by passing
the given keys as vector elements to TakeManySparseFromTensorsMap. To ensure
the correct SparseTensorsMap is accessed, ensure that the same
container and shared_name are passed to that Op. If no shared_name
is provided here, instead use the name of the Operation created by calling
AddManySparseToTensorsMap as the shared_name passed to
TakeManySparseFromTensorsMap. Ensure the Operations are colocated.
```
```
Args:
* scope: A Scope object
* sparse_indices: 2-D. The indices of the minibatch SparseTensor.
sparse_indices[:, 0] must be ordered values in [0, N).
* sparse_values: 1-D. The values of the minibatch SparseTensor.
* sparse_shape: 1-D. The shape of the minibatch SparseTensor.
The minibatch size N == sparse_shape[0].
```
```
Optional attributes (see Attrs):
* container: The container name for the SparseTensorsMap created by this op.
* shared_name: The shared name for the SparseTensorsMap created by this op.
If blank, the new Operation's unique name is used.
```
```
Returns:
* Output: 1-D. The handles of the SparseTensor now stored in the
SparseTensorsMap. Shape: [N].
```
| Constructors and Destructors |
| --- |
| `[AddManySparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a74a1831bfd1f27720873c62a4d963e68)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape)` |
| `[AddManySparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a77594a24c914fe60afa8f2fffb2be090)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape, const [AddManySparseToTensorsMap::Attrs](../../../struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a0f5ef46531573dcf0f5db668d43daa9b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sparse\_handles](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1ae6a15aa12ca7a7bdeffef3f72e82cbc2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1aa2be23efa50022636a98ca3a1901d6f9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a2019483d10b34a38eb43056dd01d0a67)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1ab252ad5ffa96d26b5cd0d7a06ca1c45b)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1ab040c34d4a6550b6f7856758403fe341)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a437ebb905e580d3d568136057b214620)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AddManySparseToTensorsMap::Attrs](../../../struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs) | Optional attribute setters for [AddManySparseToTensorsMap](add-many-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sparse\_handles
```
::tensorflow::Output sparse_handles
```
Public functions
----------------
### AddManySparseToTensorsMap
```
AddManySparseToTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape
)
```
### AddManySparseToTensorsMap
```
AddManySparseToTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape,
const AddManySparseToTensorsMap::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Softmax tensorflow::ops::Softmax
========================
`#include <nn_ops.h>`
Computes softmax activations.
Summary
-------
For each batch `i` and class `j` we have
```
$$softmax[i, j] = exp(logits[i, j]) / sum_j(exp(logits[i, j]))$$
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* logits: 2-D with shape `[batch_size, num_classes]`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same shape as `logits`.
| Constructors and Destructors |
| --- |
| `[Softmax](#classtensorflow_1_1ops_1_1_softmax_1a565ed3a9b8adbafdb0a1b2061ce9cb08)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logits)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_softmax_1ae62568a4488f40832dac845de04cff94)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[softmax](#classtensorflow_1_1ops_1_1_softmax_1af8238048a2a280f84eee57c9c1919084)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_softmax_1afda37c06f46dc3432931b9d9d88c5d2f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_softmax_1aa54bc0dd86d6e5de7ad24726ce6dd814)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_softmax_1ae17f3a9a7db00b3a8a148668fe8b45d8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### softmax
```
::tensorflow::Output softmax
```
Public functions
----------------
### Softmax
```
Softmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input logits
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MulNoNan tensorflow::ops::MulNoNan
=========================
`#include <math_ops.h>`
Returns x \* y element-wise.
Summary
-------
Returns zero if y is zero, even if x if infinite or NaN.
*NOTE*: `[MulNoNan](mul-no-nan#classtensorflow_1_1ops_1_1_mul_no_nan)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[MulNoNan](#classtensorflow_1_1ops_1_1_mul_no_nan_1a15d025b860c351d286402f02ac36a124)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_mul_no_nan_1ab7096bdb2878a090c6002cd07f014c9f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_mul_no_nan_1af6557824aa96a3e07cccd138a6d9c2ab)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_mul_no_nan_1a62470d2f83c9045772c665ee0fce4b4a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mul_no_nan_1a6789002a3c0ed1180e5a334d107fa3eb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mul_no_nan_1a3e458b4664c9fe99532b110ebeaaba66)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### MulNoNan
```
MulNoNan(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DepthToSpace tensorflow::ops::DepthToSpace
=============================
`#include <array_ops.h>`
[DepthToSpace](depth-to-space#classtensorflow_1_1ops_1_1_depth_to_space) for tensors of type T.
Summary
-------
Rearranges data from depth into blocks of spatial data. This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of the input tensor where values from the `depth` dimension are moved in spatial blocks to the `height` and `width` dimensions. The attr `block_size` indicates the input block size and how the data is moved.
* Chunks of data of size `block_size * block_size` from depth are rearranged into non-overlapping blocks of size `block_size x block_size`
* The width the output tensor is `input_depth * block_size`, whereas the height is `input_height * block_size`.
* The Y, X coordinates within each block of the output image are determined by the high order component of the input channel index.
* The depth of the input tensor must be divisible by `block_size * block_size`.
The `data_format` attr specifies the layout of the input and output tensors with the following options: "NHWC": `[ batch, height, width, channels ]` "NCHW": `[ batch, channels, height, width ]` "NCHW\_VECT\_C": `qint8 [ batch, channels / 4, height, width, 4 ]`
It is useful to consider the operation as transforming a 6-D [Tensor](../tensor#classtensorflow_1_1_tensor). e.g. for data\_format = NHWC, Each element in the input tensor can be specified via 6 coordinates, ordered by decreasing memory layout significance as: n,iY,iX,bY,bX,oC (where n=batch index, iX, iY means X or Y coordinates within the input image, bX, bY means coordinates within the output block, oC means output channels). The output would be the input transposed to the following layout: n,iY,bY,iX,bX,oC
This operation is useful for resizing the activations between convolutions (but keeping all data), e.g. instead of pooling. It is also useful for training purely convolutional models.
For example, given an input of shape `[1, 1, 1, 4]`, data\_format = "NHWC" and block\_size = 2:
```
x = [[[[1, 2, 3, 4]]]]
```
This operation will output a tensor of shape `[1, 2, 2, 1]`:
```
[[[[1], [2]],
[[3], [4]]]]
```
Here, the input has a batch of 1 and each batch element has shape `[1, 1, 4]`, the corresponding output will have 2x2 elements and will have a depth of 1 channel (1 = `4 / (block_size * block_size)`). The output element shape is `[2, 2, 1]`.
For an input tensor with larger depth, here of shape `[1, 1, 1, 12]`, e.g.
```
x = [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
```
This operation, for block size of 2, will return the following tensor of shape `[1, 2, 2, 3]`
```
[[[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]]]
```
Similarly, for the following input of shape `[1 2 2 4]`, and a block size of 2:
```
x = [[[[1, 2, 3, 4],
[5, 6, 7, 8]],
[[9, 10, 11, 12],
[13, 14, 15, 16]]]]
```
the operator will return the following tensor of shape `[1 4 4 1]`:
```
x = [[[ [1], [2], [5], [6]],
[ [3], [4], [7], [8]],
[ [9], [10], [13], [14]],
[ [11], [12], [15], [16]]]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* block\_size: The size of the spatial block, same as in Space2Depth.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[DepthToSpace](#classtensorflow_1_1ops_1_1_depth_to_space_1a2c9e364eeb7f160468ea1d96f6cfb8e6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, int64 block_size)` |
| `[DepthToSpace](#classtensorflow_1_1ops_1_1_depth_to_space_1a8f6fcb6f032b7cf643f973e6ac13c27c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, int64 block_size, const [DepthToSpace::Attrs](../../../struct/tensorflow/ops/depth-to-space/attrs#structtensorflow_1_1ops_1_1_depth_to_space_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_depth_to_space_1a957382b910309c5111ee14e1ab67e743)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_depth_to_space_1af26b151763bb3a313233613cc17a77f0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_depth_to_space_1a41b9c51a62fa577cdd60303f1e4121ab)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_depth_to_space_1a0ef22b3a73050121df809b37a5bcf10c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_depth_to_space_1a20278953425786797aa70c161f3c746b)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_depth_to_space_1abc5ed947752840207dff9d8be78c49a3)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/depth-to-space/attrs#structtensorflow_1_1ops_1_1_depth_to_space_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DepthToSpace::Attrs](../../../struct/tensorflow/ops/depth-to-space/attrs) | Optional attribute setters for [DepthToSpace](depth-to-space#classtensorflow_1_1ops_1_1_depth_to_space). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DepthToSpace
```
DepthToSpace(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
int64 block_size
)
```
### DepthToSpace
```
DepthToSpace(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
int64 block_size,
const DepthToSpace::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::GetSessionHandleV2 tensorflow::ops::GetSessionHandleV2
===================================
`#include <data_flow_ops.h>`
Store the input tensor in the state of the current session.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* value: The tensor to be stored.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle for the tensor stored in the session state, represented as a ResourceHandle object.
| Constructors and Destructors |
| --- |
| `[GetSessionHandleV2](#classtensorflow_1_1ops_1_1_get_session_handle_v2_1a83ffbda1b62173f044e96955ae678880)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_get_session_handle_v2_1a54ceabe4d3565fd799d461489dae98ea)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_get_session_handle_v2_1a4d5a7410f0f674436b4b6fa42bbf042d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_get_session_handle_v2_1aad50f95a9db3eae37bd8c41627e1251c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_get_session_handle_v2_1aa9e08d3fc80a78cc8546c0dbd9d033cc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_get_session_handle_v2_1a74a92faff5a66e5c4666a6997c11c4c4)() const` | |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### GetSessionHandleV2
```
GetSessionHandleV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input value
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Assert tensorflow::ops::Assert
=======================
`#include <logging_ops.h>`
Asserts that the given condition is true.
Summary
-------
If `condition` evaluates to false, print the list of tensors in `data`. `summarize` determines how many entries of the tensors to print.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* condition: The condition to evaluate.
* data: The tensors to print out when condition is false.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/assert/attrs#structtensorflow_1_1ops_1_1_assert_1_1_attrs)`):
* summarize: [Print](print#classtensorflow_1_1ops_1_1_print) this many entries of each tensor.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[Assert](#classtensorflow_1_1ops_1_1_assert_1af81dc219d43af5f1f57633edd6869d35)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) condition, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data)` |
| `[Assert](#classtensorflow_1_1ops_1_1_assert_1a0dc850b92e0420af7e04c28133d91328)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) condition, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data, const [Assert::Attrs](../../../struct/tensorflow/ops/assert/attrs#structtensorflow_1_1ops_1_1_assert_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_assert_1ac87c4c74ab1959fb429df106cd771128)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_assert_1a715a4538d968886307e951aaeb975e3a)() const` | |
| Public static functions |
| --- |
| `[Summarize](#classtensorflow_1_1ops_1_1_assert_1adba119f0fab568f3e6f338108ab2277f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/assert/attrs#structtensorflow_1_1ops_1_1_assert_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Assert::Attrs](../../../struct/tensorflow/ops/assert/attrs) | Optional attribute setters for [Assert](assert#classtensorflow_1_1ops_1_1_assert). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### Assert
```
Assert(
const ::tensorflow::Scope & scope,
::tensorflow::Input condition,
::tensorflow::InputList data
)
```
### Assert
```
Assert(
const ::tensorflow::Scope & scope,
::tensorflow::Input condition,
::tensorflow::InputList data,
const Assert::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Summarize
```
Attrs Summarize(
int64 x
)
```
tensorflow_cpp tensorflow::ops::StageClear tensorflow::ops::StageClear
===========================
`#include <data_flow_ops.h>`
Op removes all elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[StageClear](#classtensorflow_1_1ops_1_1_stage_clear_1a12abcf9cbe3121c3e5b04d9d4b9aa2d4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[StageClear](#classtensorflow_1_1ops_1_1_stage_clear_1ab6a2958f0cb3f74bb826648981c89eb4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [StageClear::Attrs](../../../struct/tensorflow/ops/stage-clear/attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_stage_clear_1adb7e0e2c36694a3e25f4b668b023e631)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_stage_clear_1a1d6534153e62ae2da5800baee049062d)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_stage_clear_1a4c191775d9bd72e8d6b4e5cb5fce5a66)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage-clear/attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_stage_clear_1a7f9d37fd0e37f48943e3367893d17749)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage-clear/attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_stage_clear_1aeb632a9a2e90661b9283ffcde4f8704d)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage-clear/attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_stage_clear_1aee6433cf12ebc652dc92de69644f26e9)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage-clear/attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StageClear::Attrs](../../../struct/tensorflow/ops/stage-clear/attrs) | Optional attribute setters for [StageClear](stage-clear#classtensorflow_1_1ops_1_1_stage_clear). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### StageClear
```
StageClear(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### StageClear
```
StageClear(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const StageClear::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResourceScatterNdMin tensorflow::ops::ResourceScatterNdMin
=====================================
`#include <state_ops.h>`
TODO: add doc.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A resource handle. Must be from a VarHandleOp.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of values whose element wise min is taken with ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-min/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_min_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceScatterNdMin](#classtensorflow_1_1ops_1_1_resource_scatter_nd_min_1a59d432ee156ef2a2c702c47f27cad183)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ResourceScatterNdMin](#classtensorflow_1_1ops_1_1_resource_scatter_nd_min_1a421227d29f846ab5d4ffdc499fd109d2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ResourceScatterNdMin::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-min/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_min_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_min_1a26136f2060d667da1170e4d40ccb78f1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_min_1a4a051568fd95a47d1af772b942dc237a)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_scatter_nd_min_1a8df502711b528e5f1da39d55b434c93c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-min/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_min_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceScatterNdMin::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-min/attrs) | Optional attribute setters for [ResourceScatterNdMin](resource-scatter-nd-min#classtensorflow_1_1ops_1_1_resource_scatter_nd_min). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceScatterNdMin
```
ResourceScatterNdMin(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ResourceScatterNdMin
```
ResourceScatterNdMin(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ResourceScatterNdMin::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::OrderedMapUnstage tensorflow::ops::OrderedMapUnstage
==================================
`#include <data_flow_ops.h>`
Op removes and returns the values associated with the key.
Summary
-------
from the underlying container. If the underlying container does not contain this key, the op will block until it does.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The values tensor.
| Constructors and Destructors |
| --- |
| `[OrderedMapUnstage](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1a5a26ec81dd21dcbde201b3f9f81bea27)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes)` |
| `[OrderedMapUnstage](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1a138aed174444fa1d543861217e297821)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes, const [OrderedMapUnstage::Attrs](../../../struct/tensorflow/ops/ordered-map-unstage/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1a9533938d91a943db80772e3caa628017)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1af80cbb5c41ab89735034ee91631f9f0d)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1ad9ced28ebe47785501279284d6fa5775)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1ab52cbc98f44278d5573a33ed050fdbca)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1ab519afbb326ac8918da168b4323b25e9)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1a9568596678bf33435fb5c71782f9e902)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_unstage_1aa724db1a44c21cffff20d959c2f1af72)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OrderedMapUnstage::Attrs](../../../struct/tensorflow/ops/ordered-map-unstage/attrs) | Optional attribute setters for [OrderedMapUnstage](ordered-map-unstage#classtensorflow_1_1ops_1_1_ordered_map_unstage). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### OrderedMapUnstage
```
OrderedMapUnstage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes
)
```
### OrderedMapUnstage
```
OrderedMapUnstage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes,
const OrderedMapUnstage::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseSoftmaxCrossEntropyWithLogits tensorflow::ops::SparseSoftmaxCrossEntropyWithLogits
====================================================
`#include <nn_ops.h>`
Computes softmax cross entropy cost and gradients to backpropagate.
Summary
-------
Unlike `[SoftmaxCrossEntropyWithLogits](softmax-cross-entropy-with-logits#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits)`, this operation does not accept a matrix of label probabilities, but rather a single label per row of features. This label is considered to have probability 1.0 for the given row.
Inputs are the logits, not probabilities.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* features: batch\_size x num\_classes matrix
* labels: batch\_size vector with values in [0, num\_classes). This is the label for the given minibatch entry.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` loss: Per example loss (batch\_size vector).
* `[Output](../output#classtensorflow_1_1_output)` backprop: backpropagated gradients (batch\_size x num\_classes matrix).
| Constructors and Destructors |
| --- |
| `[SparseSoftmaxCrossEntropyWithLogits](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1a965e868e103e3908d2bfb1dcd368e90d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) labels)` |
| Public attributes |
| --- |
| `[backprop](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1a9e77b4f5efe0d0762f8fc95a3f7cdbaa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[loss](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1aa3c9d1b704d919039c2cd2686fbea683)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_softmax_cross_entropy_with_logits_1ac581285ea4e5d57f85d8f317aed838fa)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### backprop
```
::tensorflow::Output backprop
```
### loss
```
::tensorflow::Output loss
```
### operation
```
Operation operation
```
Public functions
----------------
### SparseSoftmaxCrossEntropyWithLogits
```
SparseSoftmaxCrossEntropyWithLogits(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input labels
)
```
tensorflow_cpp tensorflow::ops::BarrierTakeMany tensorflow::ops::BarrierTakeMany
================================
`#include <data_flow_ops.h>`
Takes the given number of completed elements from a barrier.
Summary
-------
This operation concatenates completed-element component tensors along the 0th dimension to make a single component tensor.
Elements come out of the barrier when they are complete, and in the order in which they were placed into the barrier. The indices output provides information about the batch in which each element was originally inserted into the barrier.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a barrier.
* num\_elements: A single-element tensor containing the number of elements to take.
* component\_types: The type of each component in a value.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)`):
* allow\_small\_batch: Allow to return less than num\_elements items if barrier is already closed.
* timeout\_ms: If the queue is empty, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` indices: A one-dimensional tensor of indices, with length num\_elems. These indices refer to the batch in which the values were placed into the barrier (starting with MIN\_LONG and increasing with each [BarrierInsertMany](barrier-insert-many#classtensorflow_1_1ops_1_1_barrier_insert_many)).
* `[Output](../output#classtensorflow_1_1_output)` keys: A one-dimensional tensor of keys, with length num\_elements.
* `OutputList` values: One any-dimensional tensor per component in a barrier element. [All](all#classtensorflow_1_1ops_1_1_all) values have length num\_elements in the 0th dimension.
| Constructors and Destructors |
| --- |
| `[BarrierTakeMany](#classtensorflow_1_1ops_1_1_barrier_take_many_1a7079c660a8be7b93534d6b9342549375)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_elements, const DataTypeSlice & component_types)` |
| `[BarrierTakeMany](#classtensorflow_1_1ops_1_1_barrier_take_many_1a0bbc5e5e2af22792ad5bd4a246591fc4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_elements, const DataTypeSlice & component_types, const [BarrierTakeMany::Attrs](../../../struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[indices](#classtensorflow_1_1ops_1_1_barrier_take_many_1a43e71cac399402222c6beab7c297d2ff)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[keys](#classtensorflow_1_1ops_1_1_barrier_take_many_1aac3b84f41d8da26a1b15f6c3f8294a34)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_barrier_take_many_1ab7644c7503f6049a8eb1d9a50fa2217b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_barrier_take_many_1a55d011199c39e515002a93b15e1358a9)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public static functions |
| --- |
| `[AllowSmallBatch](#classtensorflow_1_1ops_1_1_barrier_take_many_1a58a8882a1c18ccb037a4e5876d16abde)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)` |
| `[TimeoutMs](#classtensorflow_1_1ops_1_1_barrier_take_many_1a31d75880ce856ac91e2eff9c8938ea12)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)` |
| `[WaitForIncomplete](#classtensorflow_1_1ops_1_1_barrier_take_many_1a7e1cffc4f5b0b94d3892d02b7843e02d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/barrier-take-many/attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BarrierTakeMany::Attrs](../../../struct/tensorflow/ops/barrier-take-many/attrs) | Optional attribute setters for [BarrierTakeMany](barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many). |
Public attributes
-----------------
### indices
```
::tensorflow::Output indices
```
### keys
```
::tensorflow::Output keys
```
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### BarrierTakeMany
```
BarrierTakeMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input num_elements,
const DataTypeSlice & component_types
)
```
### BarrierTakeMany
```
BarrierTakeMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input num_elements,
const DataTypeSlice & component_types,
const BarrierTakeMany::Attrs & attrs
)
```
Public static functions
-----------------------
### AllowSmallBatch
```
Attrs AllowSmallBatch(
bool x
)
```
### TimeoutMs
```
Attrs TimeoutMs(
int64 x
)
```
### WaitForIncomplete
```
Attrs WaitForIncomplete(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::TensorArrayRead tensorflow::ops::TensorArrayRead
================================
`#include <data_flow_ops.h>`
Read an element from the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into output `value`.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* flow\_in: A float scalar that enforces proper chaining of operations.
* dtype: The type of the elem that is returned.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The tensor that is read from the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
| Constructors and Destructors |
| --- |
| `[TensorArrayRead](#classtensorflow_1_1ops_1_1_tensor_array_read_1a26e7ba60509d23e4d4d195b93a9c3f5a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) index, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, DataType dtype)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_read_1a7112b6b89fbb3e0c537d278b009ed05f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[value](#classtensorflow_1_1ops_1_1_tensor_array_read_1a305497dfad1df9182c6a3909cc76d3a3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_array_read_1ace4670accbff377b307fc1c371979f26)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_array_read_1a75072de1b69985d0c110c4b679f1db63)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_array_read_1af52ff2572ce57e72dc01a14ec537b034)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### value
```
::tensorflow::Output value
```
Public functions
----------------
### TensorArrayRead
```
TensorArrayRead(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input index,
::tensorflow::Input flow_in,
DataType dtype
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DynamicStitch tensorflow::ops::DynamicStitch
==============================
`#include <data_flow_ops.h>`
Interleave the values from the `data` tensors into a single tensor.
Summary
-------
Builds a merged tensor such that
```
merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
```
For example, if each `indices[m]` is scalar or vector, we have
```
# Scalar indices:
merged[indices[m], ...] = data[m][...]
```
```
# Vector indices:
merged[indices[m][i], ...] = data[m][i, ...]
```
Each `data[i].shape` must start with the corresponding `indices[i].shape`, and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we must have `data[i].shape = indices[i].shape + constant`. In terms of this `constant`, the output shape is
```
merged.shape = [max(indices)] + constant
```
Values are merged in order, so if an index appears in both `indices[m][i]` and `indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the merged result. If you do not need this guarantee, [ParallelDynamicStitch](parallel-dynamic-stitch#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch) might perform better on some devices.
For example:
```
indices[0] = 6
indices[1] = [4, 1]
indices[2] = [[5, 2], [0, 3]]
data[0] = [61, 62]
data[1] = [[41, 42], [11, 12]]
data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
[51, 52], [61, 62]]
```
This method can be used to merge partitions created by `dynamic_partition` as illustrated on the following example:
```
# Apply function (increments x_i) on elements for which a certain condition
# apply (x_i != -1 in this example).
x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
condition_mask=tf.not_equal(x,tf.constant(-1.))
partitioned_data = tf.dynamic_partition(
x, tf.cast(condition_mask, tf.int32) , 2)
partitioned_data[1] = partitioned_data[1] + 1.0
condition_indices = tf.dynamic_partition(
tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)
x = tf.dynamic_stitch(condition_indices, partitioned_data)
# Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
# unchanged.
```

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The merged tensor.
| Constructors and Destructors |
| --- |
| `[DynamicStitch](#classtensorflow_1_1ops_1_1_dynamic_stitch_1a40683e2fafd5461794d620ec3ab75b02)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data)` |
| Public attributes |
| --- |
| `[merged](#classtensorflow_1_1ops_1_1_dynamic_stitch_1ab680171a95778bb5700d266c6d81263a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_dynamic_stitch_1aa293b5d370da3681d76bd21d745f63b3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_dynamic_stitch_1a116487484247157a3a09e30862677040)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_dynamic_stitch_1a7bea7f966421c8a58236ed192cde235f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_dynamic_stitch_1a71343c33e7d5cb4c7b9f8f68204520ff)() const` | |
Public attributes
-----------------
### merged
```
::tensorflow::Output merged
```
### operation
```
Operation operation
```
Public functions
----------------
### DynamicStitch
```
DynamicStitch(
const ::tensorflow::Scope & scope,
::tensorflow::InputList indices,
::tensorflow::InputList data
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ReaderNumWorkUnitsCompleted tensorflow::ops::ReaderNumWorkUnitsCompleted
============================================
`#include <io_ops.h>`
Returns the number of work units this Reader has finished processing.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a Reader.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The units\_completed tensor.
| Constructors and Destructors |
| --- |
| `[ReaderNumWorkUnitsCompleted](#classtensorflow_1_1ops_1_1_reader_num_work_units_completed_1a73ac2cf3c7a72de6d05e3f6334f16f15)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reader_num_work_units_completed_1a514957924db5a2c7366b1ebd8b57e399)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[units\_completed](#classtensorflow_1_1ops_1_1_reader_num_work_units_completed_1ad317d43c2f47d7ed23f2625ad0ce85d1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_reader_num_work_units_completed_1ab00e099ad97388eacd6efd27600fa3ae)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_reader_num_work_units_completed_1af80b3a840180f637bf035038f4cbcd96)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_reader_num_work_units_completed_1a153c4a99d351b6ca2b6919ddb9cc78e6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### units\_completed
```
::tensorflow::Output units_completed
```
Public functions
----------------
### ReaderNumWorkUnitsCompleted
```
ReaderNumWorkUnitsCompleted(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Pow tensorflow::ops::Pow
====================
`#include <math_ops.h>`
Computes the power of one value to another.
Summary
-------
Given a tensor `x` and a tensor `y`, this operation computes \(x^y\) for corresponding elements in `x` and `y`. For example:
```
# tensor 'x' is [[2, 2]], [3, 3]]
# tensor 'y' is [[8, 16], [2, 3]]
tf.pow(x, y) ==> [[256, 65536], [9, 27]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Pow](#classtensorflow_1_1ops_1_1_pow_1aca0c4d8d950913503421c22ff3141a2c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_pow_1a7cf450a69c0c08d103b161e9363f7e7a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_pow_1aa4df670ff306b3b060f6214659131a3e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_pow_1aebdbfbf181ed695203bc0f67e0e98daa)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_pow_1aad45efe34ec9d129f73b5df4715efdce)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_pow_1ab3d1c9b6cda9074b95ded97ba401948d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Pow
```
Pow(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Exp tensorflow::ops::Exp
====================
`#include <math_ops.h>`
Computes exponential of x element-wise.
Summary
-------
\(y = e^x\).
This function computes the exponential of every element in the input tensor. i.e. `exp(x)` or `e^(x)`, where `x` is the input tensor. `e` denotes Euler's number and is approximately equal to 2.718281. [Output](../output#classtensorflow_1_1_output) is positive for any real input.
```
x = tf.constant(2.0)
tf.math.exp(x) ==> 7.389056
```
```
x = tf.constant([2.0, 8.0])
tf.math.exp(x) ==> array([7.389056, 2980.958], dtype=float32)
```
For complex numbers, the exponential value is calculated as follows:
```
e^(x+iy) = e^x * e^iy = e^x * (cos y + i sin y)
```
Let's consider complex number 1+1j as an example. e^1 \* (cos 1 + i sin 1) = 2.7182818284590 \* (0.54030230586+0.8414709848j)
```
x = tf.constant(1 + 1j)
tf.math.exp(x) ==> 1.4686939399158851+2.2873552871788423j
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Exp](#classtensorflow_1_1ops_1_1_exp_1aa5419f33d177e95f326a2dfcad2953eb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_exp_1ac936e897598d160c335f673bf833bdeb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_exp_1acec4d597d17df94ecccfd9d29eddf575)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_exp_1af53d5710bdc80316d5e9ea12031337af)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_exp_1ae1bad90173cb03f4c2509197101438e1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_exp_1a34c367c172a44e41239ff083a588dd85)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Exp
```
Exp(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ScatterDiv tensorflow::ops::ScatterDiv
===========================
`#include <state_ops.h>`
Divides a variable reference by sparse updates.
Summary
-------
This operation computes
```
# Scalar indices
ref[indices, ...] /= updates[...]
```
```
# Vector indices (for each i)
ref[indices[i], ...] /= updates[i, ...]
```
```
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
```
This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.
Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions divide.
Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* indices: A tensor of indices into the first dimension of `ref`.
* updates: A tensor of values that `ref` is divided by.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-div/attrs#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs)`):
* use\_locking: If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterDiv](#classtensorflow_1_1ops_1_1_scatter_div_1a6f5331b7d6d93eb827b6dffc9ee8ea3e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterDiv](#classtensorflow_1_1ops_1_1_scatter_div_1a7ac34a9f909edf4380d102b00e4b3667)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterDiv::Attrs](../../../struct/tensorflow/ops/scatter-div/attrs#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_div_1a545009b3ff38f96178cb28c10e00a19e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_div_1a9dd470b2028739c52eaf7d74b2f33938)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_div_1ab42ab1d51f0a620b0c0c26e1c44dbcef)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_div_1aba889345b14720ce81925d52ebbe2d07)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_div_1a589cea85fd6873f8942f22d45f3e0022)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_div_1a1ce283b718bfb51e90d26a18d5e82722)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-div/attrs#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterDiv::Attrs](../../../struct/tensorflow/ops/scatter-div/attrs) | Optional attribute setters for [ScatterDiv](scatter-div#classtensorflow_1_1ops_1_1_scatter_div). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterDiv
```
ScatterDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterDiv
```
ScatterDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterDiv::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::ParallelDynamicStitch tensorflow::ops::ParallelDynamicStitch
======================================
`#include <data_flow_ops.h>`
Interleave the values from the `data` tensors into a single tensor.
Summary
-------
Builds a merged tensor such that
```
merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
```
For example, if each `indices[m]` is scalar or vector, we have
```
# Scalar indices:
merged[indices[m], ...] = data[m][...]
```
```
# Vector indices:
merged[indices[m][i], ...] = data[m][i, ...]
```
Each `data[i].shape` must start with the corresponding `indices[i].shape`, and the rest of `data[i].shape` must be constant w.r.t. `i`. That is, we must have `data[i].shape = indices[i].shape + constant`. In terms of this `constant`, the output shape is
```
merged.shape = [max(indices)] + constant
```
Values may be merged in parallel, so if an index appears in both `indices[m][i]` and `indices[n][j]`, the result may be invalid. This differs from the normal [DynamicStitch](dynamic-stitch#classtensorflow_1_1ops_1_1_dynamic_stitch) operator that defines the behavior in that case.
For example:
```
indices[0] = 6
indices[1] = [4, 1]
indices[2] = [[5, 2], [0, 3]]
data[0] = [61, 62]
data[1] = [[41, 42], [11, 12]]
data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
[51, 52], [61, 62]]
```
This method can be used to merge partitions created by `dynamic_partition` as illustrated on the following example:
```
# Apply function (increments x_i) on elements for which a certain condition
# apply (x_i != -1 in this example).
x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
condition_mask=tf.not_equal(x,tf.constant(-1.))
partitioned_data = tf.dynamic_partition(
x, tf.cast(condition_mask, tf.int32) , 2)
partitioned_data[1] = partitioned_data[1] + 1.0
condition_indices = tf.dynamic_partition(
tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)
x = tf.dynamic_stitch(condition_indices, partitioned_data)
# Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
# unchanged.
```

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The merged tensor.
| Constructors and Destructors |
| --- |
| `[ParallelDynamicStitch](#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch_1a6d5464f1c148b04bc28b9bff03f884d3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data)` |
| Public attributes |
| --- |
| `[merged](#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch_1acf4ad6fe444ed11732637ae9f1951f16)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch_1a339e540a99d7624dfdc0236dcaaa7fd0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch_1af337a4bfc6cb29dc5bf35e4158622436)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch_1aa13a376d3e19711dd994e37a3c97cbc8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_parallel_dynamic_stitch_1aa279ea721b609a0870436bf241c90c9f)() const` | |
Public attributes
-----------------
### merged
```
::tensorflow::Output merged
```
### operation
```
Operation operation
```
Public functions
----------------
### ParallelDynamicStitch
```
ParallelDynamicStitch(
const ::tensorflow::Scope & scope,
::tensorflow::InputList indices,
::tensorflow::InputList data
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::QueueDequeueMany tensorflow::ops::QueueDequeueMany
=================================
`#include <data_flow_ops.h>`
Dequeues `n` tuples of one or more tensors from the given queue.
Summary
-------
If the queue is closed and there are fewer than `n` elements, then an OutOfRange error is returned.
This operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. [All](all#classtensorflow_1_1ops_1_1_all) of the components in the dequeued tuple will have size `n` in the 0th dimension.
This operation has `k` outputs, where `k` is the number of components in the tuples stored in the given queue, and output `i` is the ith component of the dequeued tuple.
N.B. If the queue is empty, this operation will block until `n` elements have been dequeued (or 'timeout\_ms' elapses, if specified).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
* n: The number of tuples to dequeue.
* component\_types: The type of each component in a tuple.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/queue-dequeue-many/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_many_1_1_attrs)`):
* timeout\_ms: If the queue has fewer than n elements, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet.
Returns:
* `OutputList`: One or more tensors that were dequeued as a tuple.
| Constructors and Destructors |
| --- |
| `[QueueDequeueMany](#classtensorflow_1_1ops_1_1_queue_dequeue_many_1af0787d738d8e5c2f19921973db8e2481)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) n, const DataTypeSlice & component_types)` |
| `[QueueDequeueMany](#classtensorflow_1_1ops_1_1_queue_dequeue_many_1a8d1c93762d52332bf32cf0affcf42447)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) n, const DataTypeSlice & component_types, const [QueueDequeueMany::Attrs](../../../struct/tensorflow/ops/queue-dequeue-many/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_many_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[components](#classtensorflow_1_1ops_1_1_queue_dequeue_many_1ad008417bd88a61cc3561b12b2655e192)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_queue_dequeue_many_1a8022cd22dda1a2ece65d36a11766035d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_queue_dequeue_many_1a3b9da4a9019f580bd27704d37043f875)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[TimeoutMs](#classtensorflow_1_1ops_1_1_queue_dequeue_many_1ada0815fe9735c5da0a6192a13c574ee2)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/queue-dequeue-many/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_many_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QueueDequeueMany::Attrs](../../../struct/tensorflow/ops/queue-dequeue-many/attrs) | Optional attribute setters for [QueueDequeueMany](queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many). |
Public attributes
-----------------
### components
```
::tensorflow::OutputList components
```
### operation
```
Operation operation
```
Public functions
----------------
### QueueDequeueMany
```
QueueDequeueMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input n,
const DataTypeSlice & component_types
)
```
### QueueDequeueMany
```
QueueDequeueMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input n,
const DataTypeSlice & component_types,
const QueueDequeueMany::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### TimeoutMs
```
Attrs TimeoutMs(
int64 x
)
```
tensorflow_cpp tensorflow::ops::DecodeGif tensorflow::ops::DecodeGif
==========================
`#include <image_ops.h>`
Decode the frame(s) of a GIF-encoded image to a uint8 tensor.
Summary
-------
GIF images with frame or transparency compression are not supported. On Linux and MacOS systems, convert animated GIFs from compressed to uncompressed by running:
```
convert $src.gif -coalesce $dst.gif
```
This op also supports decoding JPEGs and PNGs, though it is cleaner to use `tf.io.decode_image`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* contents: 0-D. The GIF-encoded image.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[num_frames, height, width, 3]`. RGB channel order.
| Constructors and Destructors |
| --- |
| `[DecodeGif](#classtensorflow_1_1ops_1_1_decode_gif_1ab8423cf80c3c768f78ee1ef985638c7f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| Public attributes |
| --- |
| `[image](#classtensorflow_1_1ops_1_1_decode_gif_1a93c7d6f69c8b6e611635f88f1cf2bcd2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_decode_gif_1ad61387b03e35b009466e71ba27fb1e79)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_gif_1a2a2838eff458630e33d4e7f98fdb0a87)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_gif_1a66486826f8ac922a28aa67df6605c508)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_gif_1aeb51deab9ea7005cafb1582da6787efe)() const` | |
Public attributes
-----------------
### image
```
::tensorflow::Output image
```
### operation
```
Operation operation
```
Public functions
----------------
### DecodeGif
```
DecodeGif(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QueueSize tensorflow::ops::QueueSize
==========================
`#include <data_flow_ops.h>`
Computes the number of elements in the given queue.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The number of elements in the given queue.
| Constructors and Destructors |
| --- |
| `[QueueSize](#classtensorflow_1_1ops_1_1_queue_size_1aa827e301536e63740eb16ec27130aca6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_queue_size_1a1c3b3a869a1be97ac9144661ef134bd4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_queue_size_1abae2a57d09b2105c10dcfeac4190fdcb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_queue_size_1a9ad8a445530d2803a2b5b14051563e94)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_queue_size_1aab4588662891c572cac57833b05f4eae)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_queue_size_1a8035b4788eaece95a99f124f59e6bf55)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### QueueSize
```
QueueSize(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::NonMaxSuppressionV5 tensorflow::ops::NonMaxSuppressionV5
====================================
`#include <image_ops.h>`
Greedily selects a subset of bounding boxes in descending order of score,.
Summary
-------
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected\_indices = tf.image.non\_max\_suppression\_v2( boxes, scores, max\_output\_size, iou\_threshold, score\_threshold) selected\_boxes = tf.gather(boxes, selected\_indices) This op also supports a Soft-NMS (with Gaussian weighting) mode (c.f. Bodla et al, <https://arxiv.org/abs/1704.04503>) where boxes reduce the score of other overlapping boxes instead of directly causing them to be pruned. To enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be larger than 0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* boxes: A 2-D float tensor of shape `[num_boxes, 4]`.
* scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).
* max\_output\_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
* iou\_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
* score\_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
* soft\_nms\_sigma: A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et al (c.f. <https://arxiv.org/abs/1704.04503>). When `soft_nms_sigma=0.0` (which is default), we fall back to standard (hard) NMS.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/non-max-suppression-v5/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs)`):
* pad\_to\_max\_output\_size: If true, the output `selected_indices` is padded to be of length `max_output_size`. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` selected\_indices: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
* `[Output](../output#classtensorflow_1_1_output)` selected\_scores: A 1-D float tensor of shape `[M]` representing the corresponding scores for each selected box, where `M <= max_output_size`. Scores only differ from corresponding input scores when using Soft NMS (i.e. when `soft_nms_sigma>0`)
* `[Output](../output#classtensorflow_1_1_output)` valid\_outputs: A 0-D integer tensor representing the number of valid elements in `selected_indices`, with the valid elements appearing first.
| Constructors and Destructors |
| --- |
| `[NonMaxSuppressionV5](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a58f80a7976cd835a7edb22cdfbe9d52e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) soft_nms_sigma)` |
| `[NonMaxSuppressionV5](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a01252b578e820021a7bd241b40164251)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) soft_nms_sigma, const [NonMaxSuppressionV5::Attrs](../../../struct/tensorflow/ops/non-max-suppression-v5/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1aa96dc249a5c111b383bada5507ebf994)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[selected\_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a7c287739ff4978fb784b56224b054b21)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[selected\_scores](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1ab66338bc87549958c2b63ba5fd795530)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[valid\_outputs](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a4099ccdeda03b3fc9290a7391e811ace)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[PadToMaxOutputSize](#classtensorflow_1_1ops_1_1_non_max_suppression_v5_1a6f6209fd08cfd3bd97ba74954009db05)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/non-max-suppression-v5/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::NonMaxSuppressionV5::Attrs](../../../struct/tensorflow/ops/non-max-suppression-v5/attrs) | Optional attribute setters for [NonMaxSuppressionV5](non-max-suppression-v5#classtensorflow_1_1ops_1_1_non_max_suppression_v5). |
Public attributes
-----------------
### operation
```
Operation operation
```
### selected\_indices
```
::tensorflow::Output selected_indices
```
### selected\_scores
```
::tensorflow::Output selected_scores
```
### valid\_outputs
```
::tensorflow::Output valid_outputs
```
Public functions
----------------
### NonMaxSuppressionV5
```
NonMaxSuppressionV5(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold,
::tensorflow::Input soft_nms_sigma
)
```
### NonMaxSuppressionV5
```
NonMaxSuppressionV5(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold,
::tensorflow::Input soft_nms_sigma,
const NonMaxSuppressionV5::Attrs & attrs
)
```
Public static functions
-----------------------
### PadToMaxOutputSize
```
Attrs PadToMaxOutputSize(
bool x
)
```
tensorflow_cpp tensorflow::ops::Assign tensorflow::ops::Assign
=======================
`#include <state_ops.h>`
Update 'ref' by assigning 'value' to it.
Summary
-------
This operation outputs "ref" after the assignment is done. This makes it easier to chain operations that need to use the reset value.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node. May be uninitialized.
* value: The value to be assigned to the variable.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)`):
* validate\_shape: If true, the operation will validate that the shape of 'value' matches the shape of the [Tensor](../tensor#classtensorflow_1_1_tensor) being assigned to. If false, 'ref' will take on the shape of 'value'.
* use\_locking: If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been reset.
| Constructors and Destructors |
| --- |
| `[Assign](#classtensorflow_1_1ops_1_1_assign_1a9d092527e56dc2c2349ea73d983cf65d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` |
| `[Assign](#classtensorflow_1_1ops_1_1_assign_1a8ba8288a592f24c065bcae0d32b770f6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const [Assign::Attrs](../../../struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_assign_1a5d4c946cbed23867a165f2da7f908730)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_assign_1a20cf92e3af8c7164b3eb17ee05479ac2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_assign_1a4ec3c136c0a49e9b3e9312cdb704455f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_assign_1a3a8d284c3415f19eb7954bbf703b7af2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_assign_1aedefc46ede817c8851373351603d9508)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_assign_1a013fcdc58dfe9ea5bfd88550e231d936)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)` |
| `[ValidateShape](#classtensorflow_1_1ops_1_1_assign_1adfed4e6b56c404a19c1a4eb89e4277c8)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Assign::Attrs](../../../struct/tensorflow/ops/assign/attrs) | Optional attribute setters for [Assign](assign#classtensorflow_1_1ops_1_1_assign). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### Assign
```
Assign(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input value
)
```
### Assign
```
Assign(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input value,
const Assign::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### ValidateShape
```
Attrs ValidateShape(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Identity tensorflow::ops::Identity
=========================
`#include <array_ops.h>`
Return a tensor with the same shape and contents as the input tensor or value.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Identity](#classtensorflow_1_1ops_1_1_identity_1ae6b85807b33feefdf70315e8806059df)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_identity_1a98113a4d5a9c17c804bf47621a14400f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_identity_1a7ee1f4e902a9f4a3d91bfb1cee8ef25f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_identity_1a4f129533a74417c362c44612ecf23848)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_identity_1a2e4615bba488939eb43e196dc0cb25a4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_identity_1a29509e584ec93e61f15908d891da43fc)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Identity
```
Identity(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ExpandDims tensorflow::ops::ExpandDims
===========================
`#include <array_ops.h>`
Inserts a dimension of 1 into a tensor's shape.
Summary
-------
Given a tensor `input`, this operation inserts a dimension of 1 at the dimension index `axis` of `input`'s shape. The dimension index `axis` starts at zero; if you specify a negative number for `axis` it is counted backward from the end.
This operation is useful if you want to add a batch dimension to a single element. For example, if you have a single image of shape `[height, width, channels]`, you can make it a batch of 1 image with `expand_dims(image, 0)`, which will make the shape `[1, height, width, channels]`.
Other examples:
```
# 't' is a tensor of shape [2]
shape(expand_dims(t, 0)) ==> [1, 2]
shape(expand_dims(t, 1)) ==> [2, 1]
shape(expand_dims(t, -1)) ==> [2, 1]
```
```
# 't2' is a tensor of shape [2, 3, 5]
shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
```
This operation requires that:
`-1-input.dims() <= dim <= input.dims()`
This operation is related to `squeeze()`, which removes dimensions of size 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* axis: 0-D (scalar). Specifies the dimension index at which to expand the shape of `input`. Must be in the range `[-rank(input) - 1, rank(input)]`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Contains the same data as `input`, but its shape has an additional dimension of size 1 added.
| Constructors and Destructors |
| --- |
| `[ExpandDims](#classtensorflow_1_1ops_1_1_expand_dims_1ae2cff3dc910140a50446ed380848baef)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_expand_dims_1aefcdcc72ed92eb8f0975a90ca998bb71)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_expand_dims_1abc828c5e90fdd61142ffd01878f9f95a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_expand_dims_1a85ce8553584a8b3a50345d93f0f03b52)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_expand_dims_1aabc0c1aba83330412277a5b6e6f2c04e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_expand_dims_1a280db99846027451637ac5d7e7a9d67e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ExpandDims
```
ExpandDims(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ShardedFilename tensorflow::ops::ShardedFilename
================================
`#include <io_ops.h>`
Generate a sharded filename.
Summary
-------
The filename is printf formatted as
s-%05d-of-%05d, basename, shard, num\_shards.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The filename tensor.
| Constructors and Destructors |
| --- |
| `[ShardedFilename](#classtensorflow_1_1ops_1_1_sharded_filename_1a53a2d75edad0c2b225cceeb85fea69cc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) basename, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shard, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_shards)` |
| Public attributes |
| --- |
| `[filename](#classtensorflow_1_1ops_1_1_sharded_filename_1a2f2cec638ea75af71868cff293e3abbb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sharded_filename_1a400b7eecc9d7302fd77137ed5d8f7020)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sharded_filename_1a92a3d43cccecaef1b9e814de28b1f72f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sharded_filename_1a3a44e25739aa41afd56e54245ea2e0c0)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sharded_filename_1af0c2fabb421ebccb9e8c9527a5c716e7)() const` | |
Public attributes
-----------------
### filename
```
::tensorflow::Output filename
```
### operation
```
Operation operation
```
Public functions
----------------
### ShardedFilename
```
ShardedFilename(
const ::tensorflow::Scope & scope,
::tensorflow::Input basename,
::tensorflow::Input shard,
::tensorflow::Input num_shards
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::LogicalAnd tensorflow::ops::LogicalAnd
===========================
`#include <math_ops.h>`
Returns the truth value of x AND y element-wise.
Summary
-------
*NOTE*: `[LogicalAnd](logical-and#classtensorflow_1_1ops_1_1_logical_and)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[LogicalAnd](#classtensorflow_1_1ops_1_1_logical_and_1af9f3111b131782783944593da486c6ea)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_logical_and_1a7e98c420d645dc620c8f7b4b4516b760)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_logical_and_1ab57d788691dfd9ebdd7f1ccf083f02e8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_logical_and_1aff566fcbb7549bdf712003579d7f5fe8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_logical_and_1a4c7dc783f1b82046b6c24949b80bce65)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_logical_and_1a45e23c40e39ae2706aad1a159ca88dd7)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### LogicalAnd
```
LogicalAnd(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MatrixDiagPartV3 tensorflow::ops::MatrixDiagPartV3
=================================
`#include <array_ops.h>`
Returns the batched diagonal part of a batched tensor.
Summary
-------
Returns a tensor with the `k[0]`-th to `k[1]`-th diagonals of the batched `input`.
Assume `input` has `r` dimensions `[I, J, ..., L, M, N]`. Let `max_diag_len` be the maximum length among all diagonals to be extracted, `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))` Let `num_diags` be the number of diagonals to extract, `num_diags = k[1] - k[0] + 1`.
If `num_diags == 1`, the output tensor is of rank `r - 1` with shape `[I, J, ..., L, max_diag_len]` and values:
```
diagonal[i, j, ..., l, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
```
where `y = max(-k[1], 0)`
, `x = max(k[1], 0)`
. Otherwise, the output tensor has rank `r` with dimensions `[I, J, ..., L, num_diags, max_diag_len]` with values:
```
diagonal[i, j, ..., l, m, n]
= input[i, j, ..., l, n+y, n+x] ; if 0 <= n+y < M and 0 <= n+x < N,
padding_value ; otherwise.
```
where `d = k[1] - m`
, `y = max(-d, 0) - offset`
, and `x = max(d, 0) - offset`
. `offset` is zero except when the alignment of the diagonal is to the right.
```
offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
and `d >= 0`) or
(`align` in {LEFT_RIGHT, RIGHT_RIGHT}
and `d <= 0`)
0 ; otherwise
```
where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`
. The input must be at least a matrix.
For example:
```
input = np.array([[[1, 2, 3, 4], # Input shape: (2, 3, 4)
[5, 6, 7, 8],
[9, 8, 7, 6]],
[[5, 4, 3, 2],
[1, 2, 3, 4],
[5, 6, 7, 8]]])
```
```
# A main diagonal from each batch.
tf.matrix_diag_part(input) ==> [[1, 6, 7], # Output shape: (2, 3)
[5, 2, 7]]
```
```
# A superdiagonal from each batch.
tf.matrix_diag_part(input, k = 1)
==> [[2, 7, 6], # Output shape: (2, 3)
[4, 3, 8]]
```
```
# A band from each batch.
tf.matrix_diag_part(input, k = (-1, 2))
==> [[[0, 3, 8], # Output shape: (2, 4, 3)
[2, 7, 6],
[1, 6, 7],
[5, 8, 0]],
[[0, 3, 4],
[4, 3, 8],
[5, 2, 7],
[1, 6, 0]]]
```
```
# LEFT_RIGHT alignment.
tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
==> [[[3, 8, 0], # Output shape: (2, 4, 3)
[2, 7, 6],
[1, 6, 7],
[0, 5, 8]],
[[3, 4, 0],
[4, 3, 8],
[5, 2, 7],
[0, 1, 6]]]
```
```
# max_diag_len can be shorter than the main diagonal.
tf.matrix_diag_part(input, k = (-2, -1))
==> [[[5, 8],
[9, 0]],
[[1, 6],
[5, 0]]]
```
```
# padding_value = 9
tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
==> [[[9, 9, 4], # Output shape: (2, 3, 3)
[9, 3, 8],
[2, 7, 6]],
[[9, 9, 2],
[9, 3, 4],
[4, 3, 8]]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `r` tensor where `r >= 2`.
* k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. `k[0]` must not be larger than `k[1]`.
* padding\_value: The value to fill the area outside the specified diagonal band with. Default is 0.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/matrix-diag-part-v3/attrs#structtensorflow_1_1ops_1_1_matrix_diag_part_v3_1_1_attrs)`):
* align: Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT\_LEFT" (default), "LEFT\_RIGHT", "LEFT\_LEFT", and "RIGHT\_RIGHT". "RIGHT\_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT\_RIGHT", which is the opposite alignment.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The extracted diagonal(s).
| Constructors and Destructors |
| --- |
| `[MatrixDiagPartV3](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1abda51edecba9f012bd9118b2b4e4eb39)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, ::[tensorflow::Input](../input#classtensorflow_1_1_input) padding_value)` |
| `[MatrixDiagPartV3](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1ab2a7181a88ac68c2c1f8aa8e54d94f36)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, ::[tensorflow::Input](../input#classtensorflow_1_1_input) padding_value, const [MatrixDiagPartV3::Attrs](../../../struct/tensorflow/ops/matrix-diag-part-v3/attrs#structtensorflow_1_1ops_1_1_matrix_diag_part_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[diagonal](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1ab5b1ebb490b4c3ac451095ad9c2860ce)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1aab8e9d1b13b2fafd7954d2acc89077f3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1a42ebd82d85100f3cae0b90acce7c7d41)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1a077796bdba19bb0c51a49a758b47b2f7)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1aad6d6537777dd1424e046801937d308c)() const` | |
| Public static functions |
| --- |
| `[Align](#classtensorflow_1_1ops_1_1_matrix_diag_part_v3_1a2bd0085f20db6aaa612f12494bfd9c6e)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/matrix-diag-part-v3/attrs#structtensorflow_1_1ops_1_1_matrix_diag_part_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MatrixDiagPartV3::Attrs](../../../struct/tensorflow/ops/matrix-diag-part-v3/attrs) | Optional attribute setters for [MatrixDiagPartV3](matrix-diag-part-v3#classtensorflow_1_1ops_1_1_matrix_diag_part_v3). |
Public attributes
-----------------
### diagonal
```
::tensorflow::Output diagonal
```
### operation
```
Operation operation
```
Public functions
----------------
### MatrixDiagPartV3
```
MatrixDiagPartV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input k,
::tensorflow::Input padding_value
)
```
### MatrixDiagPartV3
```
MatrixDiagPartV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input k,
::tensorflow::Input padding_value,
const MatrixDiagPartV3::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Align
```
Attrs Align(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ApplyRMSProp tensorflow::ops::ApplyRMSProp
=============================
`#include <training_ops.h>`
Update '\*var' according to the RMSProp algorithm.
Summary
-------
Note that in dense implementation of this algorithm, ms and mom will update even if the grad is zero, but in this sparse implementation, ms and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon)
ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms + epsilon) var <- var - mom
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_apply_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyRMSProp](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1a590f878f7698fa0f56a0b5226d658855)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyRMSProp](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1a4d5ef1aee8f989dbbe2c16e3538482b2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyRMSProp::Attrs](../../../struct/tensorflow/ops/apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_apply_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1a412619ace9b4ff26ec14ae0ecfb8ac11)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1a72a4daee4e9ef1d2a3f3d4a088ed010f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1a82fe90ad87c393e443f8459e9b0158db)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1aabbb7630a5cd439e4694eda0021d694d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1a4e664360fbdde8291f80a08b2347fdf0)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_r_m_s_prop_1ae0d5824bd2a81852e1e2185346adb9c3)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_apply_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyRMSProp::Attrs](../../../struct/tensorflow/ops/apply-r-m-s-prop/attrs) | Optional attribute setters for [ApplyRMSProp](apply-r-m-s-prop#classtensorflow_1_1ops_1_1_apply_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyRMSProp
```
ApplyRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ApplyRMSProp
```
ApplyRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ApplyRMSProp::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::LRN tensorflow::ops::LRN
====================
`#include <nn_ops.h>`
Local Response Normalization.
Summary
-------
The 4-D `input` tensor is treated as a 3-D array of 1-D vectors (along the last dimension), and each vector is normalized independently. Within a given vector, each component is divided by the weighted, squared sum of inputs within `depth_radius`. In detail,
```
sqr_sum[a, b, c, d] =
sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
output = input / (bias + alpha * sqr_sum) ** beta
```
For details, see [Krizhevsky et al., ImageNet classification with deep convolutional neural networks (NIPS 2012)](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/l-r-n/attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)`):
* depth\_radius: 0-D. Half-width of the 1-D normalization window.
* bias: An offset (usually positive to avoid dividing by 0).
* alpha: A scale factor, usually positive.
* beta: An exponent.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[LRN](#classtensorflow_1_1ops_1_1_l_r_n_1adbadf9462bc6ae9916f535bb2aa2762f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[LRN](#classtensorflow_1_1ops_1_1_l_r_n_1ab702d3657c46710fcf7a63f7c712c5df)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [LRN::Attrs](../../../struct/tensorflow/ops/l-r-n/attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_l_r_n_1a001e6e41e5fb3ff78b42decdd680ea82)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_l_r_n_1a69396918e55e1de00f68a1113ef173b0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_l_r_n_1aa28d07232c5df13dad811653f1276a2a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_l_r_n_1aa00d48e5a8ca805aa2532b7155b8c28b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_l_r_n_1ae58da447d50c92abb12785d8ab7b618b)() const` | |
| Public static functions |
| --- |
| `[Alpha](#classtensorflow_1_1ops_1_1_l_r_n_1a7788a93182ddfbf8bb5bd1820b081392)(float x)` | `[Attrs](../../../struct/tensorflow/ops/l-r-n/attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` |
| `[Beta](#classtensorflow_1_1ops_1_1_l_r_n_1a6bbb26306e2265f6e2368f5dfb39ef13)(float x)` | `[Attrs](../../../struct/tensorflow/ops/l-r-n/attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` |
| `[Bias](#classtensorflow_1_1ops_1_1_l_r_n_1ac8da24639c0d90ef6e68df756f3e345f)(float x)` | `[Attrs](../../../struct/tensorflow/ops/l-r-n/attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` |
| `[DepthRadius](#classtensorflow_1_1ops_1_1_l_r_n_1ac579054901f30ab7fd4989ca39237a0e)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/l-r-n/attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::LRN::Attrs](../../../struct/tensorflow/ops/l-r-n/attrs) | Optional attribute setters for [LRN](l-r-n#classtensorflow_1_1ops_1_1_l_r_n). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### LRN
```
LRN(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### LRN
```
LRN(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const LRN::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Alpha
```
Attrs Alpha(
float x
)
```
### Beta
```
Attrs Beta(
float x
)
```
### Bias
```
Attrs Bias(
float x
)
```
### DepthRadius
```
Attrs DepthRadius(
int64 x
)
```
tensorflow_cpp tensorflow::ops::SparseSparseMinimum tensorflow::ops::SparseSparseMinimum
====================================
`#include <sparse_ops.h>`
Returns the element-wise min of two SparseTensors.
Summary
-------
Assumes the two SparseTensors have the same shape, i.e., no broadcasting.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* a\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, in the canonical lexicographic ordering.
* a\_values: 1-D. `N` non-empty values corresponding to `a_indices`.
* a\_shape: 1-D. Shape of the input SparseTensor.
* b\_indices: counterpart to `a_indices` for the other operand.
* b\_values: counterpart to `a_values` for the other operand; must be of the same dtype.
* b\_shape: counterpart to `a_shape` for the other operand; the two shapes must be equal.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. The indices of the output SparseTensor.
* `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. The values of the output SparseTensor.
| Constructors and Destructors |
| --- |
| `[SparseSparseMinimum](#classtensorflow_1_1ops_1_1_sparse_sparse_minimum_1a618817c1bf273d356c39d50665159337)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_sparse_minimum_1a33f88f5db64cfd7952d1e77a3fbc7484)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_sparse_minimum_1a7453ec5556b383b524e2f500ceb09bb4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_sparse_minimum_1a38a8cf1da768df6042ab605760ace807)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseSparseMinimum
```
SparseSparseMinimum(
const ::tensorflow::Scope & scope,
::tensorflow::Input a_indices,
::tensorflow::Input a_values,
::tensorflow::Input a_shape,
::tensorflow::Input b_indices,
::tensorflow::Input b_values,
::tensorflow::Input b_shape
)
```
tensorflow_cpp tensorflow::ops::TensorArraySize tensorflow::ops::TensorArraySize
================================
`#include <data_flow_ops.h>`
Get the current size of the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) (output of [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) or [TensorArrayGrad](tensor-array-grad#classtensorflow_1_1ops_1_1_tensor_array_grad)).
* flow\_in: A float scalar that enforces proper chaining of operations.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The current size of the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
| Constructors and Destructors |
| --- |
| `[TensorArraySize](#classtensorflow_1_1ops_1_1_tensor_array_size_1a79ec3226fc0d0569b593f360c891ec31)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_size_1a5c730a883f1e21d895bcada863651bec)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_tensor_array_size_1ae4d19a80be163a77ee25c51aa493ecd1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_array_size_1ac4c62f0751ca427d590f9253ec56833d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_array_size_1a7139e8996042f9f764325c38d8ede02d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_array_size_1a3483d2685da6512b105467550968691e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### TensorArraySize
```
TensorArraySize(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input flow_in
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DataFormatVecPermute tensorflow::ops::DataFormatVecPermute
=====================================
`#include <nn_ops.h>`
Permute input tensor from `src_format` to `dst_format`.
Summary
-------
[Input](../input#classtensorflow_1_1_input) tensor must be a vector of size 4, or a 4x2 tensor.
For example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and inputs:
```
[1, 2, 3, 4]
```
and
```
[[1, 2, 3, 4],
[5, 6, 7, 8]]
```
, the outputs will be (respectively):
```
[1, 4, 2, 3]
```
and
```
[[1, 4, 2, 3],
[5, 8, 6, 7]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: Vector of size 4 or [Tensor](../tensor#classtensorflow_1_1_tensor) of shape (4, 2) in source data format.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)`):
* src\_format: source data format.
* dst\_format: destination data format.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Vector of size 4 or [Tensor](../tensor#classtensorflow_1_1_tensor) of shape (4, 2) in destination data format.
| Constructors and Destructors |
| --- |
| `[DataFormatVecPermute](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a8babb4c1e126e473efe79cc7083f1f6d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| `[DataFormatVecPermute](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a6d0e6d800f5d0411c873343c3ce89ba9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, const [DataFormatVecPermute::Attrs](../../../struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1ac65cce7f5ddf5ef7efd6543c6f83c491)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a47a3e96570db483721681a470526eacd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1ac6c53640d6b53b6bb728f92a7d426855)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a8c97823cde5e0028f42b19a28d8855d0)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a19f5f9a816b2d7941524d4966f60c5a5)() const` | |
| Public static functions |
| --- |
| `[DstFormat](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1af8e8527150fac801f3e4db0686f97871)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)` |
| `[SrcFormat](#classtensorflow_1_1ops_1_1_data_format_vec_permute_1a466d9b4a767bff538cc2de0b2c8992aa)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/data-format-vec-permute/attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DataFormatVecPermute::Attrs](../../../struct/tensorflow/ops/data-format-vec-permute/attrs) | Optional attribute setters for [DataFormatVecPermute](data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute). |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### DataFormatVecPermute
```
DataFormatVecPermute(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### DataFormatVecPermute
```
DataFormatVecPermute(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
const DataFormatVecPermute::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DstFormat
```
Attrs DstFormat(
StringPiece x
)
```
### SrcFormat
```
Attrs SrcFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::TruncatedNormal tensorflow::ops::TruncatedNormal
================================
`#include <random_ops.h>`
Outputs random values from a truncated normal distribution.
Summary
-------
The generated values follow a normal distribution with mean 0 and standard deviation 1, except that values whose magnitude is more than 2 standard deviations from the mean are dropped and re-picked.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: The shape of the output tensor.
* dtype: The type of the output.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor of the specified shape filled with random truncated normal values.
| Constructors and Destructors |
| --- |
| `[TruncatedNormal](#classtensorflow_1_1ops_1_1_truncated_normal_1affc5d8efb95031e4d6866afea6db4885)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype)` |
| `[TruncatedNormal](#classtensorflow_1_1ops_1_1_truncated_normal_1a0c16f49d32f82c76b2f48fe989d40ede)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype, const [TruncatedNormal::Attrs](../../../struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_truncated_normal_1a94e86733620c725cfd18c220e7befc91)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_truncated_normal_1ab70e3146207138655b0a57215318f04a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_truncated_normal_1a1a306e31c92dabe3e30540b020a5d2cd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_truncated_normal_1a2ad5d4b0f4e2b937af0d1f4b903fec79)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_truncated_normal_1a1e4ef0edec5a8828733bb2a0b7ba01e0)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_truncated_normal_1a16a37eaf4346dae9789c2dcadf2bd7cc)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_truncated_normal_1a678db3a004d1f6bdd50b02a65ca1efc6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TruncatedNormal::Attrs](../../../struct/tensorflow/ops/truncated-normal/attrs) | Optional attribute setters for [TruncatedNormal](truncated-normal#classtensorflow_1_1ops_1_1_truncated_normal). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### TruncatedNormal
```
TruncatedNormal(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype
)
```
### TruncatedNormal
```
TruncatedNormal(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype,
const TruncatedNormal::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::CountUpTo tensorflow::ops::CountUpTo
==========================
`#include <state_ops.h>`
Increments 'ref' until it reaches 'limit'.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a scalar `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* limit: If incrementing ref would bring it above limit, instead generates an 'OutOfRange' error.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A copy of the input before increment. If nothing else modifies the input, the values produced will all be distinct.
| Constructors and Destructors |
| --- |
| `[CountUpTo](#classtensorflow_1_1ops_1_1_count_up_to_1a8e312ef44f15d31e4aeab02aa13bab92)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, int64 limit)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_count_up_to_1a6375a212ad79358549763db02e6d67cc)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_count_up_to_1a197a681069a4b7425466c72ebf9aa9e6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_count_up_to_1ab2ba97fcf76a8506b6bde0300dda5a8e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_count_up_to_1a9de83029d3a9d01cfe07058ede299108)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_count_up_to_1a0db42bbc82750886632775f3c46445e8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### CountUpTo
```
CountUpTo(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
int64 limit
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::TensorArraySplit tensorflow::ops::TensorArraySplit
=================================
`#include <data_flow_ops.h>`
Split the data from the input value into [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements.
Summary
-------
Assuming that `lengths` takes on values
(n0, n1, ..., n(T-1))
```
and that `value` has shape
```
(n0 + n1 + ... + n(T-1) x d0 x d1 x ...)```, this splits values into a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) with T tensors.
[TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) index t will be the subtensor of values with starting position
```(n0 + n1 + ... + n(t-1), 0, 0, ...)
```
and having size
```
nt x d0 x d1 x ...``` Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* value: The concatenated tensor to write to the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* lengths: The vector of lengths, how to split the rows of value into the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* flow\_in: A float scalar that enforces proper chaining of operations.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A float scalar that enforces proper chaining of operations.
| Constructors and Destructors |
| --- |
| `[TensorArraySplit](#classtensorflow_1_1ops_1_1_tensor_array_split_1ae33a80f5f64f1d0ce47cb9ba380ee6bb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lengths, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in)` |
| Public attributes |
| --- |
| `[flow\_out](#classtensorflow_1_1ops_1_1_tensor_array_split_1a6a6beee076f43e4045b8327c9a8f0be9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_split_1a1cf9133d6b7032ba48abeff356547a58)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_array_split_1ad03cc93202545e0234d90faee0425ed9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_array_split_1ac2029be4ba96df5da32f6bd0fc3fb8b1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_array_split_1ab90a5c257e9a8df6209a663ade45e3fc)() const` | |
Public attributes
-----------------
### flow\_out
```
::tensorflow::Output flow_out
```
### operation
```
Operation operation
```
Public functions
----------------
### TensorArraySplit
```
TensorArraySplit(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input value,
::tensorflow::Input lengths,
::tensorflow::Input flow_in
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FloorMod tensorflow::ops::FloorMod
=========================
`#include <math_ops.h>`
Returns element-wise remainder of division.
Summary
-------
When `x < 0` xor `y < 0` is
true, this follows Python semantics in that the result here is consistent with a flooring divide. E.g. `floor(x / y) * y + mod(x, y) = x`.
*NOTE*: `[FloorMod](floor-mod#classtensorflow_1_1ops_1_1_floor_mod)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[FloorMod](#classtensorflow_1_1ops_1_1_floor_mod_1a34457c7c33286a90d5b2877cf949255a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_floor_mod_1a3a085f39f4494b346d655dee742ee76f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_floor_mod_1ac4d9bd96ad307be9f91f52b0aad17227)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_floor_mod_1a76a8f84a099ed7f2172c23952b8e56bc)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_floor_mod_1a40e8c3fb00de30f9b6f361d180336097)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_floor_mod_1ad99a283a5c4fede4a1dd8801952061d2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### FloorMod
```
FloorMod(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::EditDistance tensorflow::ops::EditDistance
=============================
`#include <array_ops.h>`
Computes the (possibly normalized) Levenshtein Edit Distance.
Summary
-------
The inputs are variable-length sequences provided by SparseTensors (hypothesis\_indices, hypothesis\_values, hypothesis\_shape) and (truth\_indices, truth\_values, truth\_shape).
The inputs are:
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* hypothesis\_indices: The indices of the hypothesis list SparseTensor. This is an N x R int64 matrix.
* hypothesis\_values: The values of the hypothesis list SparseTensor. This is an N-length vector.
* hypothesis\_shape: The shape of the hypothesis list SparseTensor. This is an R-length vector.
* truth\_indices: The indices of the truth list SparseTensor. This is an M x R int64 matrix.
* truth\_values: The values of the truth list SparseTensor. This is an M-length vector.
* truth\_shape: truth indices, vector.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/edit-distance/attrs#structtensorflow_1_1ops_1_1_edit_distance_1_1_attrs)`):
* normalize: boolean (if true, edit distances are normalized by length of truth).
The output is:
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A dense float tensor with rank R - 1.
For the example input:
```
// hypothesis represents a 2x1 matrix with variable-length values:
// (0,0) = ["a"]
// (1,0) = ["b"]
hypothesis_indices = [[0, 0, 0],
[1, 0, 0]]
hypothesis_values = ["a", "b"]
hypothesis_shape = [2, 1, 1]
// truth represents a 2x2 matrix with variable-length values:
// (0,0) = []
// (0,1) = ["a"]
// (1,0) = ["b", "c"]
// (1,1) = ["a"]
truth_indices = [[0, 1, 0],
[1, 0, 0],
[1, 0, 1],
[1, 1, 0]]
truth_values = ["a", "b", "c", "a"]
truth_shape = [2, 2, 2]
normalize = true
```
The output will be:
```
// output is a 2x2 matrix with edit distances normalized by truth lengths.
output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis
[0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis
```
| Constructors and Destructors |
| --- |
| `[EditDistance](#classtensorflow_1_1ops_1_1_edit_distance_1a98448a482111a3a9542eb10497edfbdf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) hypothesis_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) hypothesis_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) hypothesis_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) truth_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) truth_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) truth_shape)` |
| `[EditDistance](#classtensorflow_1_1ops_1_1_edit_distance_1a71ebfcdcb0c51272c8a1952352c23386)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) hypothesis_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) hypothesis_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) hypothesis_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) truth_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) truth_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) truth_shape, const [EditDistance::Attrs](../../../struct/tensorflow/ops/edit-distance/attrs#structtensorflow_1_1ops_1_1_edit_distance_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_edit_distance_1ad892f698a1eede4c4a5e8a315e9d49f4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_edit_distance_1aa1567444ddf9495875bb89e4815572b6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_edit_distance_1a37f2320123595e25c3b22b85bb73e4de)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_edit_distance_1a0b07c2848a5af99f253674fbe909f3ef)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_edit_distance_1a3dde48ed219986c41f1a0a0409658ae1)() const` | |
| Public static functions |
| --- |
| `[Normalize](#classtensorflow_1_1ops_1_1_edit_distance_1ab7877a4f848a5e5f6682247e07a67cbb)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/edit-distance/attrs#structtensorflow_1_1ops_1_1_edit_distance_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::EditDistance::Attrs](../../../struct/tensorflow/ops/edit-distance/attrs) | Optional attribute setters for [EditDistance](edit-distance#classtensorflow_1_1ops_1_1_edit_distance). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### EditDistance
```
EditDistance(
const ::tensorflow::Scope & scope,
::tensorflow::Input hypothesis_indices,
::tensorflow::Input hypothesis_values,
::tensorflow::Input hypothesis_shape,
::tensorflow::Input truth_indices,
::tensorflow::Input truth_values,
::tensorflow::Input truth_shape
)
```
### EditDistance
```
EditDistance(
const ::tensorflow::Scope & scope,
::tensorflow::Input hypothesis_indices,
::tensorflow::Input hypothesis_values,
::tensorflow::Input hypothesis_shape,
::tensorflow::Input truth_indices,
::tensorflow::Input truth_values,
::tensorflow::Input truth_shape,
const EditDistance::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Normalize
```
Attrs Normalize(
bool x
)
```
tensorflow_cpp tensorflow::ops::Log1p tensorflow::ops::Log1p
======================
`#include <math_ops.h>`
Computes natural logarithm of (1 + x) element-wise.
Summary
-------
I.e., \(y = \log\_e (1 + x)\).
Example:
```
x = tf.constant([0, 0.5, 1, 5])
tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Log1p](#classtensorflow_1_1ops_1_1_log1p_1a6e9048b86c2996e6858cd62ff38cf392)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_log1p_1aa439a4e488b3fe02bd0d0d1fd72d3160)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_log1p_1ac2b26438dd827c008dfcd6ebcffccfb9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_log1p_1ae506b0246cf5425972312a31f3b6e042)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_log1p_1ac7d42648889609ae8f4a510d2e5d11e8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_log1p_1a16d47d239785506c2fcd39750d26154c)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Log1p
```
Log1p(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::OrderedMapUnstageNoKey tensorflow::ops::OrderedMapUnstageNoKey
=======================================
`#include <data_flow_ops.h>`
Op removes and returns the (key, value) element with the smallest.
Summary
-------
key from the underlying container. If the underlying container does not contain elements, the op will block until it does.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)` key
* `OutputList` values
| Constructors and Destructors |
| --- |
| `[OrderedMapUnstageNoKey](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1a13815ef44ee7ada0d46cc3da94a8218c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes)` |
| `[OrderedMapUnstageNoKey](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1a9d6a2270bbbf93d73392f6037304629b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes, const [OrderedMapUnstageNoKey::Attrs](../../../struct/tensorflow/ops/ordered-map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[key](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1a093c087e20504da5867a8ff2364b9f91)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1a52ee2fd04041cc00db63941465571765)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1a57ef4dc734cada9f18b5fb1fde4a0261)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1afda39b6f4b1a6bf1926b11d6ab35cec9)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1ac01be69212d051200e1c1473e900bcbb)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1a87de87997f87a0f1e18a9e1d48103af8)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1aa160f8843fb5937c135172d0fbffe381)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-unstage-no-key/attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OrderedMapUnstageNoKey::Attrs](../../../struct/tensorflow/ops/ordered-map-unstage-no-key/attrs) | Optional attribute setters for [OrderedMapUnstageNoKey](ordered-map-unstage-no-key#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key). |
Public attributes
-----------------
### key
```
::tensorflow::Output key
```
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### OrderedMapUnstageNoKey
```
OrderedMapUnstageNoKey(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
const DataTypeSlice & dtypes
)
```
### OrderedMapUnstageNoKey
```
OrderedMapUnstageNoKey(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
const DataTypeSlice & dtypes,
const OrderedMapUnstageNoKey::Attrs & attrs
)
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::DeepCopy tensorflow::ops::DeepCopy
=========================
`#include <array_ops.h>`
Makes a copy of `x`.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: The source tensor of type `T`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: y: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `T`. A copy of `x`. Guaranteed that `y` is not an alias of `x`.
| Constructors and Destructors |
| --- |
| `[DeepCopy](#classtensorflow_1_1ops_1_1_deep_copy_1aac67e730be989adb533ffe56f14329ba)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_deep_copy_1a12214d06964bd912e9365fd420ca9aed)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_deep_copy_1a7bdd4eeb4fa0caf46dfb2f959dadcae4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_deep_copy_1ae69b83f5a2057f7b6e9b1eef40578c11)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_deep_copy_1ad277f34fe1995250ac2532c39540e3e4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_deep_copy_1a575373d27419eeddbec18ac48679a7f6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### DeepCopy
```
DeepCopy(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Print tensorflow::ops::Print
======================
`#include <logging_ops.h>`
Prints a list of tensors.
Summary
-------
Passes `input` through to `output` and prints `data` when evaluating.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The tensor passed to `output`
* data: A list of tensors to print out when op is evaluated.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/print/attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)`):
* message: A string, prefix of the error message.
* first\_n: Only log `first_n` number of times. -1 disables logging.
* summarize: Only print this many entries of each tensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The unmodified `input` tensor
| Constructors and Destructors |
| --- |
| `[Print](#classtensorflow_1_1ops_1_1_print_1a045114616a75209031b16a91ab6886a9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data)` |
| `[Print](#classtensorflow_1_1ops_1_1_print_1ae0e888fac9448baecd014b7719cc2661)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data, const [Print::Attrs](../../../struct/tensorflow/ops/print/attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_print_1a74c21680e82124c4aef96b82bea9a7d5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_print_1a1f291767a55bb0a6588edc7a21b0aa22)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_print_1a459fd07f913ed9a5af7cc577ee59e150)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_print_1a2dc81db16b755a870dd256181cc4b37c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_print_1ae39f8736788e2a1a9af58da9750e4d3b)() const` | |
| Public static functions |
| --- |
| `[FirstN](#classtensorflow_1_1ops_1_1_print_1a86911253c358a4ceddcb6b053000f4af)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/print/attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)` |
| `[Message](#classtensorflow_1_1ops_1_1_print_1ad7c6e26201c3c6667ee8775498ec8247)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/print/attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)` |
| `[Summarize](#classtensorflow_1_1ops_1_1_print_1a4a677e49c007384d2535eb7cae7157a6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/print/attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Print::Attrs](../../../struct/tensorflow/ops/print/attrs) | Optional attribute setters for [Print](print#classtensorflow_1_1ops_1_1_print). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Print
```
Print(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::InputList data
)
```
### Print
```
Print(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::InputList data,
const Print::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### FirstN
```
Attrs FirstN(
int64 x
)
```
### Message
```
Attrs Message(
StringPiece x
)
```
### Summarize
```
Attrs Summarize(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseReshape tensorflow::ops::SparseReshape
==============================
`#include <sparse_ops.h>`
Reshapes a SparseTensor to represent values in a new dense shape.
Summary
-------
This operation has the same semantics as reshape on the represented dense tensor. The `input_indices` are recomputed based on the requested `new_shape`.
If one component of `new_shape` is the special value -1, the size of that dimension is computed so that the total dense size remains constant. At most one component of `new_shape` can be -1. The number of dense elements implied by `new_shape` must be the same as the number of dense elements originally implied by `input_shape`.
Reshaping does not affect the order of values in the SparseTensor.
If the input tensor has rank `R_in` and `N` non-empty values, and `new_shape` has length `R_out`, then `input_indices` has shape `[N, R_in]`, `input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and `output_shape` has length `R_out`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_indices: 2-D. `N x R_in` matrix with the indices of non-empty values in a SparseTensor.
* input\_shape: 1-D. `R_in` vector with the input SparseTensor's dense shape.
* new\_shape: 1-D. `R_out` vector with the requested new dense shape.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. `N x R_out` matrix with the updated indices of non-empty values in the output SparseTensor.
* `[Output](../output#classtensorflow_1_1_output)` output\_shape: 1-D. `R_out` vector with the full dense shape of the output SparseTensor. This is the same as `new_shape` but with any -1 dimensions filled in.
| Constructors and Destructors |
| --- |
| `[SparseReshape](#classtensorflow_1_1ops_1_1_sparse_reshape_1a57501c2498594b147ac9bb4b371ab2ef)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) new_shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_reshape_1a19240d0378428b2bf0b30ef7badcea50)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_reshape_1a3c4d3f0b4883e4bacc4c3ba450e72431)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_reshape_1a93b02c760fe2a4ea9a8495f1f8151c51)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
Public functions
----------------
### SparseReshape
```
SparseReshape(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_shape,
::tensorflow::Input new_shape
)
```
tensorflow_cpp tensorflow::ops::EnsureShape tensorflow::ops::EnsureShape
============================
`#include <array_ops.h>`
Ensures that the tensor's shape matches the expected shape.
Summary
-------
Raises an error if the input tensor's shape does not match the specified shape. Returns the input tensor otherwise.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A tensor, whose shape is to be validated.
* shape: The expected (possibly partially specified) shape of the input tensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor with the same shape and contents as the input tensor or value.
| Constructors and Destructors |
| --- |
| `[EnsureShape](#classtensorflow_1_1ops_1_1_ensure_shape_1a5eccae9b4752e5ce978003d1413e5c06)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, PartialTensorShape shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ensure_shape_1abc933208d9ec4b02b93fd9fbf992457b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_ensure_shape_1a3de25be53998f6b3c1fe4f88c0b7f90a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ensure_shape_1affd7b08d440e2fcd688949c62b747b6d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ensure_shape_1afd5278e7b8083f310fa151d3e6ca6569)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ensure_shape_1a9ced601bdda49a6b52e0695a81bdee19)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### EnsureShape
```
EnsureShape(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
PartialTensorShape shape
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Unstage tensorflow::ops::Unstage
========================
`#include <data_flow_ops.h>`
Op is similar to a lightweight Dequeue.
Summary
-------
The basic functionality is similar to dequeue with many fewer capabilities and options. This Op is optimized for performance.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The values tensor.
| Constructors and Destructors |
| --- |
| `[Unstage](#classtensorflow_1_1ops_1_1_unstage_1a0392255be7c8fa6424b7572d3bfb6cec)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[Unstage](#classtensorflow_1_1ops_1_1_unstage_1acaa1f57f45f4271bf1b0c0ec69e7821d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [Unstage::Attrs](../../../struct/tensorflow/ops/unstage/attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_unstage_1adbc10de916d1fdb5a22c552e96a8082b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_unstage_1ae81d8183e4d39fe90a28ee8f3a15d96d)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_unstage_1ac4f86b70f9cb3c1083395a575e805675)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_unstage_1a1e22f1cdf46343e53788eb49acb303d5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/unstage/attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_unstage_1a04c661b6caffe16ceba9d535f667a2a1)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/unstage/attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_unstage_1ae16271cf7663bb4ce89a8458e7ac466c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/unstage/attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_unstage_1af0b6e3fcb731c0b9c839bbc221d6d7c8)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/unstage/attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Unstage::Attrs](../../../struct/tensorflow/ops/unstage/attrs) | Optional attribute setters for [Unstage](unstage#classtensorflow_1_1ops_1_1_unstage). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### Unstage
```
Unstage(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### Unstage
```
Unstage(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const Unstage::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyRMSProp tensorflow::ops::ResourceSparseApplyRMSProp
===========================================
`#include <training_ops.h>`
Update '\*var' according to the RMSProp algorithm.
Summary
-------
Note that in dense implementation of this algorithm, ms and mom will update even if the grad is zero, but in this sparse implementation, ms and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon)
ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms + epsilon) var <- var - mom
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var, ms and mom.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyRMSProp](#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1aff53e99b8e6dc505fb48976158d11f39)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[ResourceSparseApplyRMSProp](#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1aba358e7d7c7d78bfcdc5eaed2530fa16)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [ResourceSparseApplyRMSProp::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1abcff2e138b5825b7fe66d8d9e68c9b7f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1ae4f96774d9e75c094f13f6ea8d5ca0b6)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1a19ab4ce72ae4d3db4e8b7daa0c72ff60)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyRMSProp::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-r-m-s-prop/attrs) | Optional attribute setters for [ResourceSparseApplyRMSProp](resource-sparse-apply-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyRMSProp
```
ResourceSparseApplyRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### ResourceSparseApplyRMSProp
```
ResourceSparseApplyRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices,
const ResourceSparseApplyRMSProp::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::RandomPoissonV2 tensorflow::ops::RandomPoissonV2
================================
`#include <random_ops.h>`
Outputs random values from the Poisson distribution(s) described by rate.
Summary
-------
This op uses two algorithms, depending on rate. If rate >= 10, then the algorithm by Hormann is used to acquire samples via transformation-rejection. See <http://www.sciencedirect.com/science/article/pii/0167668793909974>.
Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform random variables. See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer Programming, Volume 2. Addison Wesley
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: 1-D integer tensor. Shape of independent samples to draw from each distribution described by the shape parameters given in rate.
* rate: A tensor in which each scalar is a "rate" parameter describing the associated poisson distribution.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor with shape `shape + shape(rate)`. Each slice `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for `rate[i0, i1, ...iN]`.
| Constructors and Destructors |
| --- |
| `[RandomPoissonV2](#classtensorflow_1_1ops_1_1_random_poisson_v2_1ac6781b746b5d655d44cf7298d0ec0e8d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rate)` |
| `[RandomPoissonV2](#classtensorflow_1_1ops_1_1_random_poisson_v2_1affe491853f03c22d0d69fe155380690d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rate, const [RandomPoissonV2::Attrs](../../../struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a8a6d22a45ef402122008fd37ae60584a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_random_poisson_v2_1aacc4e0f70e7215919fd2ed050cc778ec)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a2c4c1c5791ce65536c0711c345c5104f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a680111c81759da8f485b7c57830a97c8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_poisson_v2_1ab0e8e0cee5576ad5d628eb26db934fc6)() const` | |
| Public static functions |
| --- |
| `[Dtype](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a16ea2843b7cb14092e392a1634d5f9d3)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a4923276f993adff27a39549f725e140c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a3db3d3b1dcf6fd61014a43d46719c992)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomPoissonV2::Attrs](../../../struct/tensorflow/ops/random-poisson-v2/attrs) | Optional attribute setters for [RandomPoissonV2](random-poisson-v2#classtensorflow_1_1ops_1_1_random_poisson_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RandomPoissonV2
```
RandomPoissonV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input rate
)
```
### RandomPoissonV2
```
RandomPoissonV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input rate,
const RandomPoissonV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Dtype
```
Attrs Dtype(
DataType x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::SampleDistortedBoundingBox tensorflow::ops::SampleDistortedBoundingBox
===========================================
`#include <image_ops.h>`
Generate a single randomly distorted bounding box for an image.
Summary
-------
Bounding box annotations are often supplied in addition to ground-truth labels in image recognition or object localization tasks. A common technique for training such a system is to randomly distort an image while preserving its content, i.e. *data augmentation*. This Op outputs a randomly distorted localization of an object, i.e. bounding box, given an `image_size`, `bounding_boxes` and a series of constraints.
The output of this Op is a single bounding box that may be used to crop the original image. The output is returned as 3 tensors: `begin`, `size` and `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize what the bounding box looks like.
Bounding boxes are supplied and returned as `[y_min, x_min, y_max, x_max]`. The bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and height of the underlying image.
For example,
```
# Generate a single distorted bounding box.
begin, size, bbox_for_draw = tf.image.sample_distorted_bounding_box(
tf.shape(image),
bounding_boxes=bounding_boxes)
```
```
# Draw the bounding box in an image summary.
image_with_box = tf.image.draw_bounding_boxes(tf.expand_dims(image, 0),
bbox_for_draw)
tf.summary.image('images_with_box', image_with_box)
```
```
# Employ the bounding box to distort the image.
distorted_image = tf.slice(image, begin, size)
```
Note that if no bounding box information is available, setting `use_image_if_no_bounding_boxes = true` will assume there is a single implicit bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is false and no bounding boxes are supplied, an error is raised.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* image\_size: 1-D, containing `[height, width, channels]`.
* bounding\_boxes: 3-D with shape `[batch, N, 4]` describing the N bounding boxes associated with the image.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
* min\_object\_covered: The cropped area of the image must contain at least this fraction of any bounding box supplied. The value of this parameter should be non-negative. In the case of 0, the cropped area does not need to overlap any of the bounding boxes supplied.
* aspect\_ratio\_range: The cropped area of the image must have an aspect ratio = width / height within this range.
* area\_range: The cropped area of the image must contain a fraction of the supplied image within this range.
* max\_attempts: Number of attempts at generating a cropped region of the image of the specified constraints. After `max_attempts` failures, return the entire image.
* use\_image\_if\_no\_bounding\_boxes: Controls behavior if no bounding boxes supplied. If true, assume an implicit bounding box covering the whole input. If false, raise an error.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` begin: 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to `tf.slice`.
* `[Output](../output#classtensorflow_1_1_output)` size: 1-D, containing `[target_height, target_width, -1]`. Provide as input to `tf.slice`.
* `[Output](../output#classtensorflow_1_1_output)` bboxes: 3-D with shape `[1, 1, 4]` containing the distorted bounding box. Provide as input to `tf.image.draw_bounding_boxes`.
| Constructors and Destructors |
| --- |
| `[SampleDistortedBoundingBox](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a021ed3a4ffa7ed0cbe3d98c088ce6e5c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bounding_boxes)` |
| `[SampleDistortedBoundingBox](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1af821be29f65e93ffc361ed8eaf0aec86)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bounding_boxes, const [SampleDistortedBoundingBox::Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[bboxes](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1aee2279ee4a03be14d869ebd6f8958a33)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[begin](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1ada2c6d0817a82a6dbec40ee9d5182f9b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a26d9c8b5c6c30f43253edc3158381339)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a500da32b33dc39f1287669192357709b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[AreaRange](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a4f0add4d91089befcaaeeaef7e8708aa)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| `[AspectRatioRange](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a6778b4e519eb66d91cfc8cf875a35516)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| `[MaxAttempts](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1abe98fbac41e9bb092f94c11111d4602c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| `[MinObjectCovered](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a6516caf5b769f3defd633ad1521fa9ff)(float x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1a2982f9362e414e1427443a0e21aad53c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1ab86d2540a3733d65f994f86810bb85b4)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| `[UseImageIfNoBoundingBoxes](#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1ad3726dbe014117d519e0ce88aa37e644)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SampleDistortedBoundingBox::Attrs](../../../struct/tensorflow/ops/sample-distorted-bounding-box/attrs) | Optional attribute setters for [SampleDistortedBoundingBox](sample-distorted-bounding-box#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box). |
Public attributes
-----------------
### bboxes
```
::tensorflow::Output bboxes
```
### begin
```
::tensorflow::Output begin
```
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### SampleDistortedBoundingBox
```
SampleDistortedBoundingBox(
const ::tensorflow::Scope & scope,
::tensorflow::Input image_size,
::tensorflow::Input bounding_boxes
)
```
### SampleDistortedBoundingBox
```
SampleDistortedBoundingBox(
const ::tensorflow::Scope & scope,
::tensorflow::Input image_size,
::tensorflow::Input bounding_boxes,
const SampleDistortedBoundingBox::Attrs & attrs
)
```
Public static functions
-----------------------
### AreaRange
```
Attrs AreaRange(
const gtl::ArraySlice< float > & x
)
```
### AspectRatioRange
```
Attrs AspectRatioRange(
const gtl::ArraySlice< float > & x
)
```
### MaxAttempts
```
Attrs MaxAttempts(
int64 x
)
```
### MinObjectCovered
```
Attrs MinObjectCovered(
float x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
### UseImageIfNoBoundingBoxes
```
Attrs UseImageIfNoBoundingBoxes(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Bincount tensorflow::ops::Bincount
=========================
`#include <math_ops.h>`
Counts the number of occurrences of each value in an integer array.
Summary
-------
Outputs a vector with length `size` and the same dtype as `weights`. If `weights` are empty, then index `i` stores the number of times the value `i` is counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of the value in `weights` at each index where the corresponding value in `arr` is `i`.
Values in `arr` outside of the range [0, size) are ignored.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* arr: int32 `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* size: non-negative int32 scalar `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* weights: is an int32, int64, float32, or float64 `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as `arr`, or a length-0 `[Tensor](../tensor#classtensorflow_1_1_tensor)`, in which case it acts as all weights equal to 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with length equal to `size`. The counts or summed weights for each value in the range [0, size).
| Constructors and Destructors |
| --- |
| `[Bincount](#classtensorflow_1_1ops_1_1_bincount_1aab467738732ef3a8009ad662ba4d3821)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) arr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights)` |
| Public attributes |
| --- |
| `[bins](#classtensorflow_1_1ops_1_1_bincount_1ac125b9a1515efa737f727151bfeaaa73)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_bincount_1ab09a9d72c4506a6911bfbe00775dde37)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_bincount_1a4e41f60ef9fb7473b6aa1d8b939e11db)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bincount_1a3ac1f5104aacae7c5ed57e9a2094a80a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bincount_1a05eb54bb4dcf8b07c04cd58c4232d229)() const` | |
Public attributes
-----------------
### bins
```
::tensorflow::Output bins
```
### operation
```
Operation operation
```
Public functions
----------------
### Bincount
```
Bincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input arr,
::tensorflow::Input size,
::tensorflow::Input weights
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Sum tensorflow::ops::Sum
====================
`#include <math_ops.h>`
Computes the sum of elements across dimensions of a tensor.
Summary
-------
Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The tensor to reduce.
* axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sum/attrs#structtensorflow_1_1ops_1_1_sum_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor.
Aliases:
* ReduceSum
| Constructors and Destructors |
| --- |
| `[Sum](#classtensorflow_1_1ops_1_1_sum_1a341324ed38971337938f58c4dd0266d5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[Sum](#classtensorflow_1_1ops_1_1_sum_1a4eda74597ef4aa27ffc9e46faa44784a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Sum::Attrs](../../../struct/tensorflow/ops/sum/attrs#structtensorflow_1_1ops_1_1_sum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sum_1a8c15531c7f77d5644e4fc462aa71b50d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sum_1aadcd98e136a98408ff471057a1470e21)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sum_1a1f8bb7a4a82b5cdab23f43564703dc08)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sum_1af520ee8ec9e5caf488ebb719a26a91e8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sum_1a85412c1763adffff3c4f0d0fe7a8e433)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_sum_1a3ed061476e46b79f5e6ec8bdd28dd3e0)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sum/attrs#structtensorflow_1_1ops_1_1_sum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Sum::Attrs](../../../struct/tensorflow/ops/sum/attrs) | Optional attribute setters for [Sum](sum#classtensorflow_1_1ops_1_1_sum). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Sum
```
Sum(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis
)
```
### Sum
```
Sum(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis,
const Sum::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::MirrorPad tensorflow::ops::MirrorPad
==========================
`#include <array_ops.h>`
Pads a tensor with mirrored values.
Summary
-------
This operation pads a `input` with mirrored values according to the `paddings` you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates how many values to add before the contents of `input` in that dimension, and `paddings[D, 1]` indicates how many values to add after the contents of `input` in that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater than `input.dim_size(D)` (or `input.dim_size(D) - 1`) if `copy_border` is true (if false, respectively).
The padded size of each dimension D of the output is:
`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`
For example:
```
# 't' is [[1, 2, 3], [4, 5, 6]].
# 'paddings' is [[1, 1]], [2, 2]].
# 'mode' is SYMMETRIC.
# rank of 't' is 2.
pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
[2, 1, 1, 2, 3, 3, 2]
[5, 4, 4, 5, 6, 6, 5]
[5, 4, 4, 5, 6, 6, 5]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The input tensor to be padded.
* paddings: A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of `input`.
* mode: Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions do not include the borders, while in symmetric mode the padded regions do include the borders. For example, if `input` is `[1, 2, 3]` and `paddings` is `[0, 2]`, then the output is `[1, 2, 3, 2, 1]` in reflect mode, and it is `[1, 2, 3, 3, 2]` in symmetric mode.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The padded tensor.
| Constructors and Destructors |
| --- |
| `[MirrorPad](#classtensorflow_1_1ops_1_1_mirror_pad_1ade8674bcac38c7b92e49227402b3aeab)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) paddings, StringPiece mode)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_mirror_pad_1a20963b11eba097a4a292d10fe912fe9f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_mirror_pad_1acddc2951f705b38786a6c90517025bbd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_mirror_pad_1ac601ae413e0e24707abfe6bd6e000e3e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mirror_pad_1a27d0164d159236fcb1639d0dd7604c31)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mirror_pad_1a682f1e9bfbad14b9b9529733b71dba26)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MirrorPad
```
MirrorPad(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input paddings,
StringPiece mode
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DecodeCompressed tensorflow::ops::DecodeCompressed
=================================
`#include <parsing_ops.h>`
Decompress strings.
Summary
-------
This op decompresses each element of the `bytes` input `[Tensor](../tensor#classtensorflow_1_1_tensor)`, which is assumed to be compressed using the given `compression_type`.
The `output` is a string `[Tensor](../tensor#classtensorflow_1_1_tensor)` of the same shape as `bytes`, each element containing the decompressed data from the corresponding element in `bytes`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* bytes: A [Tensor](../tensor#classtensorflow_1_1_tensor) of string which is compressed.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-compressed/attrs#structtensorflow_1_1ops_1_1_decode_compressed_1_1_attrs)`):
* compression\_type: A scalar containing either (i) the empty string (no compression), (ii) "ZLIB", or (iii) "GZIP".
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) with the same shape as input `bytes`, uncompressed from bytes.
| Constructors and Destructors |
| --- |
| `[DecodeCompressed](#classtensorflow_1_1ops_1_1_decode_compressed_1ab8554357582adeda4632efa64b36aa6c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bytes)` |
| `[DecodeCompressed](#classtensorflow_1_1ops_1_1_decode_compressed_1addfbc931c39601dfa456a863b56d6122)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bytes, const [DecodeCompressed::Attrs](../../../struct/tensorflow/ops/decode-compressed/attrs#structtensorflow_1_1ops_1_1_decode_compressed_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_decode_compressed_1a49d742aa9a8c17d55967615a90021a8a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_decode_compressed_1ab6e1dc1de724893df3f343dc2478ae44)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_compressed_1ae93480b60d3827520c7310efcafeb089)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_compressed_1ad10af605db615b0d1f8a6e48722a69e9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_compressed_1acfae46ee5362b2a4cf2619c372a971f0)() const` | |
| Public static functions |
| --- |
| `[CompressionType](#classtensorflow_1_1ops_1_1_decode_compressed_1a09ef6d2bac5f47fc0bd7ed850345ab83)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/decode-compressed/attrs#structtensorflow_1_1ops_1_1_decode_compressed_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodeCompressed::Attrs](../../../struct/tensorflow/ops/decode-compressed/attrs) | Optional attribute setters for [DecodeCompressed](decode-compressed#classtensorflow_1_1ops_1_1_decode_compressed). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DecodeCompressed
```
DecodeCompressed(
const ::tensorflow::Scope & scope,
::tensorflow::Input bytes
)
```
### DecodeCompressed
```
DecodeCompressed(
const ::tensorflow::Scope & scope,
::tensorflow::Input bytes,
const DecodeCompressed::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### CompressionType
```
Attrs CompressionType(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::RequantizationRange tensorflow::ops::RequantizationRange
====================================
`#include <math_ops.h>`
Computes a range that covers the actual values present in a quantized tensor.
Summary
-------
Given a quantized tensor described by `(input, input_min, input_max)`, outputs a range that covers the actual values present in that tensor. This op is typically used to produce the `requested_output_min` and `requested_output_max` for `[Requantize](requantize#classtensorflow_1_1ops_1_1_requantize)`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_min: The float value that the minimum quantized input value represents.
* input\_max: The float value that the maximum quantized input value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_min: The computed min output.
* `[Output](../output#classtensorflow_1_1_output)` output\_max: the computed max output.
| Constructors and Destructors |
| --- |
| `[RequantizationRange](#classtensorflow_1_1ops_1_1_requantization_range_1a4d54c3391bd95eedc608f03b3aed9c30)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_requantization_range_1afed0a008f6d5039ad8b33ae859d0c4e3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_max](#classtensorflow_1_1ops_1_1_requantization_range_1a5908cd7341e67e52ce19e4ed8663965f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_min](#classtensorflow_1_1ops_1_1_requantization_range_1a85e00a462564fca8261bab66f911c54a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_max
```
::tensorflow::Output output_max
```
### output\_min
```
::tensorflow::Output output_min
```
Public functions
----------------
### RequantizationRange
```
RequantizationRange(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max
)
```
tensorflow_cpp tensorflow::ops::AdjustSaturation tensorflow::ops::AdjustSaturation
=================================
`#include <image_ops.h>`
Adjust the saturation of one or more images.
Summary
-------
`images` is a tensor of at least 3 dimensions. The last dimension is interpreted as channels, and must be three.
The input image is considered in the RGB colorspace. Conceptually, the RGB colors are first mapped into HSV. A scale is then applied all the saturation values, and then remapped back to RGB colorspace.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: Images to adjust. At least 3-D.
* scale: A float scale to add to the saturation.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The hue-adjusted image or images.
| Constructors and Destructors |
| --- |
| `[AdjustSaturation](#classtensorflow_1_1ops_1_1_adjust_saturation_1a47cd9a146bf280dcd4bed111e35df35e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_adjust_saturation_1a4d7f7c27cbbdda825e016da48e6ac0e8)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_adjust_saturation_1a504be90e696510fdcfc95ff05b351f62)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_adjust_saturation_1a8106decce6b90c560154227933028802)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_adjust_saturation_1a8ee6c792ccd9ac086ba0e44b3e43f730)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_adjust_saturation_1ac3cb2a3bdb3ad1e20f42d9b1f95fecc6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### AdjustSaturation
```
AdjustSaturation(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input scale
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Elu tensorflow::ops::Elu
====================
`#include <nn_ops.h>`
Computes the exponential linear function.
Summary
-------
The ELU function is defined as:
* $ e ^ x - 1 $ if $ x < 0 $
* $ x $ if $ x >= 0 $
Examples:
tf.nn.elu(1.0) tf.nn.elu(0.0) tf.nn.elu(-1000.0)
See [Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)](http://arxiv.org/abs/1511.07289)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The activations tensor.
| Constructors and Destructors |
| --- |
| `[Elu](#classtensorflow_1_1ops_1_1_elu_1adf847a32436cd3658b1dad52ad5caf25)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_elu_1ad612f9089f722691463235a242609c24)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_elu_1acd0919fdde115c26cebce79cf16da724)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_elu_1a9ba564f87829d2fa52e0b90a8172d4c8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_elu_1a389f92cb5ed5daa9f6143834155b5ab4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_elu_1ac37d3e682783d5bd1c01c96f6207d540)() const` | |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### operation
```
Operation operation
```
Public functions
----------------
### Elu
```
Elu(
const ::tensorflow::Scope & scope,
::tensorflow::Input features
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::FusedBatchNormV3 tensorflow::ops::FusedBatchNormV3
=================================
`#include <nn_ops.h>`
Batch normalization.
Summary
-------
Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for input data.
* scale: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.
* offset: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for offset, to shift to the normalized x.
* mean: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for population mean. Used for inference only; must be empty for training.
* variance: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for population variance. Used for inference only; must be empty for training.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)`):
* epsilon: A small float number added to the variance of x.
* data\_format: The data format for x and y. Either "NHWC" (default) or "NCHW".
* is\_training: A bool value to indicate the operation is for training (default) or inference.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` y: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for output data.
* `[Output](../output#classtensorflow_1_1_output)` batch\_mean: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be used by TensorFlow to compute the running mean.
* `[Output](../output#classtensorflow_1_1_output)` batch\_variance: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance, to be used by TensorFlow to compute the running variance.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_1: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be reused in the gradient computation.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_2: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case), to be reused in the gradient computation.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_3: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for some intermediate results, to be reused in the gradient computation for better efficiency.
| Constructors and Destructors |
| --- |
| `[FusedBatchNormV3](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a0c4fb237e3016f27469f290bfbafbe91)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offset, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mean, ::[tensorflow::Input](../input#classtensorflow_1_1_input) variance)` |
| `[FusedBatchNormV3](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1aea443f31981c736e706119c35e8f13a6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offset, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mean, ::[tensorflow::Input](../input#classtensorflow_1_1_input) variance, const [FusedBatchNormV3::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[batch\_mean](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a2019538f9c6047970d82b08c19c7b509)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[batch\_variance](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1aa96c58545665aa016e05a88642fefc82)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1ad809561eb5c6ed5a7d8ab713a88d6835)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reserve\_space\_1](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a51dd0d19379a79c31eca3b1b413bfac2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_2](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a2f3905c8b6e3af7579a0796967bb8190)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_3](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a0dc88cf4ea014413e2aed2ec822b1b1a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[y](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a009491887c89c093fb4908048a31e2e0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1ac29754c177308349415d675c6caa7c5d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` |
| `[Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1ae32ad66acaf9899082b5232fc92ef633)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` |
| `[ExponentialAvgFactor](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1ac18e7a6af4a2d120c8caedf78d37011e)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` |
| `[IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_v3_1a4cf1ad2c741027b4987c42a1ce8a3083)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedBatchNormV3::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-v3/attrs) | Optional attribute setters for [FusedBatchNormV3](fused-batch-norm-v3#classtensorflow_1_1ops_1_1_fused_batch_norm_v3). |
Public attributes
-----------------
### batch\_mean
```
::tensorflow::Output batch_mean
```
### batch\_variance
```
::tensorflow::Output batch_variance
```
### operation
```
Operation operation
```
### reserve\_space\_1
```
::tensorflow::Output reserve_space_1
```
### reserve\_space\_2
```
::tensorflow::Output reserve_space_2
```
### reserve\_space\_3
```
::tensorflow::Output reserve_space_3
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### FusedBatchNormV3
```
FusedBatchNormV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input offset,
::tensorflow::Input mean,
::tensorflow::Input variance
)
```
### FusedBatchNormV3
```
FusedBatchNormV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input offset,
::tensorflow::Input mean,
::tensorflow::Input variance,
const FusedBatchNormV3::Attrs & attrs
)
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Epsilon
```
Attrs Epsilon(
float x
)
```
### ExponentialAvgFactor
```
Attrs ExponentialAvgFactor(
float x
)
```
### IsTraining
```
Attrs IsTraining(
bool x
)
```
tensorflow_cpp tensorflow::ops::DecodeBase64 tensorflow::ops::DecodeBase64
=============================
`#include <string_ops.h>`
Decode web-safe base64-encoded strings.
Summary
-------
[Input](../input#classtensorflow_1_1_input) may or may not have padding at the end. See [EncodeBase64](https://www.tensorflow.org/api_docs/python/tf/io/encode_base64) for padding. Web-safe means that input must use - and \_ instead of + and /.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Base64 strings to decode.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Decoded strings.
| Constructors and Destructors |
| --- |
| `[DecodeBase64](#classtensorflow_1_1ops_1_1_decode_base64_1a1a11346071788d2ce0594b8f5ad71055)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_decode_base64_1af1dfd061dee95e178b8169661196bee4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_decode_base64_1a36caf673d79e67ae87e7d07b99fec16c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_base64_1a4faaf6843b42134a58c9cbdcff5554c3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_base64_1a2fb5db4a719f35f1c9b9c777e11b7b50)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_base64_1afc2d8a9eaca2bf0bbdb13c0308f79f90)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DecodeBase64
```
DecodeBase64(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ParallelConcat tensorflow::ops::ParallelConcat
===============================
`#include <array_ops.h>`
Concatenates a list of `N` tensors along the first dimension.
Summary
-------
The input tensors are all required to have size 1 in the first dimension.
For example:
```
# 'x' is [[1, 4]]
# 'y' is [[2, 5]]
# 'z' is [[3, 6]]
parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.
```
The difference between concat and parallel\_concat is that concat requires all of the inputs be computed before the operation will begin but doesn't require that the input shapes be known during graph construction. Parallel concat will copy pieces of the input into the output as they become available, in some situations this can provide a performance benefit.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* values: Tensors to be concatenated. [All](all#classtensorflow_1_1ops_1_1_all) must have size 1 in the first dimension and same shape.
* shape: the final shape of the result; should be equal to the shapes of any input but with the number of input values in the first dimension.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The concatenated tensor.
| Constructors and Destructors |
| --- |
| `[ParallelConcat](#classtensorflow_1_1ops_1_1_parallel_concat_1a60020ca0a0ad9b1f1f1ab296cc49745d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, PartialTensorShape shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_parallel_concat_1af663fb0e8d0b48dbdd39c4663f6a995c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_parallel_concat_1ad8442cea6d8145bdcdc7fa4546c3a25c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_parallel_concat_1ac4a6ff40acbc954f1d49c80fc94645df)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_parallel_concat_1a2bf16ff17da885269b998bbd3053caea)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_parallel_concat_1ab99eff81cc7f72feedcba5cb98e7b689)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ParallelConcat
```
ParallelConcat(
const ::tensorflow::Scope & scope,
::tensorflow::InputList values,
PartialTensorShape shape
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Div tensorflow::ops::Div
====================
`#include <math_ops.h>`
Returns x / y element-wise.
Summary
-------
*NOTE*: `[Div](div#classtensorflow_1_1ops_1_1_div)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Div](#classtensorflow_1_1ops_1_1_div_1a054fe4324e90c7c176da608e392b7637)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_div_1ab5ba7b6a0e263f02656ca2dce6485db4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_div_1aed0e3d2d7de04934ef2e594cd60f4713)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_div_1a0916babb727b3ef1775a931ec7a31d02)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_div_1acc5a5acb67a30d7a7a74e560106385c5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_div_1aebdece79827eb75bdfa33235af4f1a66)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Div
```
Div(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StringUpper tensorflow::ops::StringUpper
============================
`#include <string_ops.h>`
Converts all lowercase characters into their respective uppercase replacements.
Summary
-------
Example:
tf.strings.upper("CamelCase string and ALL CAPS")
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The input to be upper-cased.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-upper/attrs#structtensorflow_1_1ops_1_1_string_upper_1_1_attrs)`):
* encoding: Character encoding of `input`. Allowed values are '' and 'utf-8'. Value '' is interpreted as ASCII.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[StringUpper](#classtensorflow_1_1ops_1_1_string_upper_1a9e425c0a42d95ed1fa2501e07b6ef73b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[StringUpper](#classtensorflow_1_1ops_1_1_string_upper_1aec6561e03f1d562fa685abce39283016)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [StringUpper::Attrs](../../../struct/tensorflow/ops/string-upper/attrs#structtensorflow_1_1ops_1_1_string_upper_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_upper_1afc4310ee1517fcf4b193cdc7a5f6b13a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_upper_1a8b3ec887a6cf7def56fdc8f160d22c8d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_upper_1a8f173b7fe3b11700a562fb263feec8b2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_upper_1a64ca4419491547ba347209ff4a086735)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_upper_1a0e6bb9ade642625d6f3d10ecc156b86e)() const` | |
| Public static functions |
| --- |
| `[Encoding](#classtensorflow_1_1ops_1_1_string_upper_1af217c5874240be5ab930a7eff5e299e4)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/string-upper/attrs#structtensorflow_1_1ops_1_1_string_upper_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringUpper::Attrs](../../../struct/tensorflow/ops/string-upper/attrs) | Optional attribute setters for [StringUpper](string-upper#classtensorflow_1_1ops_1_1_string_upper). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringUpper
```
StringUpper(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### StringUpper
```
StringUpper(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const StringUpper::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Encoding
```
Attrs Encoding(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::FractionalAvgPool tensorflow::ops::FractionalAvgPool
==================================
`#include <nn_ops.h>`
Performs fractional average pooling on the input.
Summary
-------
Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are generated, a mean operation is performed instead of a max operation in each pooling region.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* value: 4-D with shape `[batch, height, width, channels]`.
* pooling\_ratio: Pooling ratio for each dimension of `value`, currently only supports row and col dimension and should be >= 1.0. For example, a valid pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements must be 1.0 because we don't allow pooling on batch and channels dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions respectively.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)`):
* pseudo\_random: When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for difference between pseudorandom and random.
* overlapping: When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example:
`index 0 1 2 3 4`
`value 20 5 16 3 7`
If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [41/3, 26/3] for fractional avg pooling.
* deterministic: When set to True, a fixed pooling region will be used when iterating over a [FractionalAvgPool](fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) node in the computation graph. Mainly used in unit test to make [FractionalAvgPool](fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) deterministic.
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output: output tensor after fractional avg pooling.
* `[Output](../output#classtensorflow_1_1_output)` row\_pooling\_sequence: row pooling sequence, needed to calculate gradient.
* `[Output](../output#classtensorflow_1_1_output)` col\_pooling\_sequence: column pooling sequence, needed to calculate gradient.
| Constructors and Destructors |
| --- |
| `[FractionalAvgPool](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a83af6f6e93dbac2bf42ad6afc05d2a86)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const gtl::ArraySlice< float > & pooling_ratio)` |
| `[FractionalAvgPool](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1afe59c1134290e6cfe190960e53e836ed)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const gtl::ArraySlice< float > & pooling_ratio, const [FractionalAvgPool::Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[col\_pooling\_sequence](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a253a9b7940b383f04c70aa5254f52995)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a8b1bbb7c981afe922b39753597ab754b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a72c1fe35152d17096cfcd5ca3d626e24)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[row\_pooling\_sequence](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1aef40ec50b456803bb75a8474cdc29fcb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Deterministic](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a286c7e7d0ea4b667eb0fca780f6c8fd8)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` |
| `[Overlapping](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a561400c14f7e0877122cf0faad67b785)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` |
| `[PseudoRandom](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1aaeb0a37c716692070fa056b6f164adab)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1a691079eab5c004dc817e928c12380fe5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_fractional_avg_pool_1aba6caf6e7f50e68e728b8ac9357b9353)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FractionalAvgPool::Attrs](../../../struct/tensorflow/ops/fractional-avg-pool/attrs) | Optional attribute setters for [FractionalAvgPool](fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool). |
Public attributes
-----------------
### col\_pooling\_sequence
```
::tensorflow::Output col_pooling_sequence
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
### row\_pooling\_sequence
```
::tensorflow::Output row_pooling_sequence
```
Public functions
----------------
### FractionalAvgPool
```
FractionalAvgPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const gtl::ArraySlice< float > & pooling_ratio
)
```
### FractionalAvgPool
```
FractionalAvgPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const gtl::ArraySlice< float > & pooling_ratio,
const FractionalAvgPool::Attrs & attrs
)
```
Public static functions
-----------------------
### Deterministic
```
Attrs Deterministic(
bool x
)
```
### Overlapping
```
Attrs Overlapping(
bool x
)
```
### PseudoRandom
```
Attrs PseudoRandom(
bool x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Barrier tensorflow::ops::Barrier
========================
`#include <data_flow_ops.h>`
Defines a barrier that persists across different graph executions.
Summary
-------
A barrier represents a key-value map, where each key is a string, and each value is a tuple of tensors.
At runtime, the barrier contains 'complete' and 'incomplete' elements. A complete element has defined tensors for all components of its value tuple, and may be accessed using [BarrierTakeMany](barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many). An incomplete element has some undefined components in its value tuple, and may be updated using [BarrierInsertMany](barrier-insert-many#classtensorflow_1_1ops_1_1_barrier_insert_many).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* component\_types: The type of each component in a value.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)`):
* shapes: The shape of each component in a value. Each shape must be 1 in the first dimension. The length of this attr must be the same as the length of component\_types.
* capacity: The capacity of the barrier. The default capacity is MAX\_INT32, which is the largest capacity of the underlying queue.
* container: If non-empty, this barrier is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this barrier will be shared under the given name across multiple sessions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to the barrier.
| Constructors and Destructors |
| --- |
| `[Barrier](#classtensorflow_1_1ops_1_1_barrier_1ae400cc957e34014ea577177c9ee259a7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types)` |
| `[Barrier](#classtensorflow_1_1ops_1_1_barrier_1a16852c2beb26f3659acdabc69c948e91)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types, const [Barrier::Attrs](../../../struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_barrier_1a999e0c86fdd1442995bd4dcd49f55f75)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_barrier_1a66ea0f34005305664b3a8c2b7237c73b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_barrier_1a0572d54a742a10d03a030edd48180865)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_barrier_1a4b6914f3b4916e256dd1b02e731c71b3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_barrier_1a00b400c1c0d2a50625e5f1deefd7510f)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_barrier_1a393954a81f232e756e680fc9e091595d)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_barrier_1af53271d59cca63c440ef591e790c1a0a)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` |
| `[Shapes](#classtensorflow_1_1ops_1_1_barrier_1a6f503841ebe322db85d2826f56de4fb8)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_barrier_1a704c1a8c990c6afe3854ddc6cf9d3d6e)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/barrier/attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Barrier::Attrs](../../../struct/tensorflow/ops/barrier/attrs) | Optional attribute setters for [Barrier](barrier#classtensorflow_1_1ops_1_1_barrier). |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### Barrier
```
Barrier(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
```
### Barrier
```
Barrier(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types,
const Barrier::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### Shapes
```
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::OnesLike tensorflow::ops::OnesLike
=========================
`#include <array_ops.h>`
Returns a tensor of ones with the same shape and type as x.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: a tensor of type T.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: a tensor of the same shape and type as x but filled with ones.
| Constructors and Destructors |
| --- |
| `[OnesLike](#classtensorflow_1_1ops_1_1_ones_like_1a9ce5ff05ed7a04ebf915963d1d8435f7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ones_like_1ac15e18a4a512477f8e10e519abfcd6b7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_ones_like_1ac6af054ea600a2d677e11ec5900b7ee4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ones_like_1a53d2c8964e88803f776b16e1df73c514)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ones_like_1a775247133ef103fc360424785831c02b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ones_like_1a321015b1e5fdb2859fc8126f97dc2b12)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### OnesLike
```
OnesLike(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::TensorSummaryV2 tensorflow::ops::TensorSummaryV2
================================
`#include <logging_ops.h>`
Outputs a `Summary` protocol buffer with a tensor and per-plugin data.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* tag: A string attached to this summary. Used for organization in TensorBoard.
* tensor: A tensor to serialize.
* serialized\_summary\_metadata: A serialized SummaryMetadata proto. Contains plugin data.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The summary tensor.
| Constructors and Destructors |
| --- |
| `[TensorSummaryV2](#classtensorflow_1_1ops_1_1_tensor_summary_v2_1ae4d9f13a8cda5ca768e26fb2b2fe3011)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tag, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized_summary_metadata)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_summary_v2_1a1b498d099ec8ec375e28af9ba454bf7b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[summary](#classtensorflow_1_1ops_1_1_tensor_summary_v2_1a6b792c9f3c6063da8097cba5f7def05b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_summary_v2_1ad09282ad83638be513d856c7a3925c60)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_summary_v2_1a4944187c981147ce4d8924b2165a4b94)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_summary_v2_1aaba8ff081daeab0e94d5a321f5c95522)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### summary
```
::tensorflow::Output summary
```
Public functions
----------------
### TensorSummaryV2
```
TensorSummaryV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input tag,
::tensorflow::Input tensor,
::tensorflow::Input serialized_summary_metadata
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::CheckNumerics tensorflow::ops::CheckNumerics
==============================
`#include <array_ops.h>`
Checks a tensor for NaN and Inf values.
Summary
-------
When run, reports an `InvalidArgument` error if `tensor` has any values that are not a number (NaN) or infinity (Inf). Otherwise, returns the input tensor.
Example usage:
```
a = tf.Variable(1.0)
tf.debugging.check_numerics(a, message='')
```
```
b = tf.Variable(np.nan)
try:
tf.debugging.check_numerics(b, message='Checking b')
except Exception as e:
assert "Checking b : Tensor had NaN values" in e.message
```
```
c = tf.Variable(np.inf)
try:
tf.debugging.check_numerics(c, message='Checking c')
except Exception as e:
assert "Checking c : Tensor had Inf values" in e.message
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* message: Prefix of the error message.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[CheckNumerics](#classtensorflow_1_1ops_1_1_check_numerics_1af1c19dffbcae2ab5c9ab6ee90d68ec39)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor, StringPiece message)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_check_numerics_1ad484b4d4b0b09c34c94fcdbded72b9da)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_check_numerics_1a88bf227894d8d0ee71fc1c7554210e1d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_check_numerics_1a9fe40ccbb9d64c89016c3e944fc32a9b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_check_numerics_1a886f83ed684f5fff6fa69f1d8abdc2a7)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_check_numerics_1a83d2ddff85742175c356e1d71aab2635)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### CheckNumerics
```
CheckNumerics(
const ::tensorflow::Scope & scope,
::tensorflow::Input tensor,
StringPiece message
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Minimum tensorflow::ops::Minimum
========================
`#include <math_ops.h>`
Returns the min of x and y (i.e.
Summary
-------
x < y ? x : y) element-wise.
*NOTE*: `[Minimum](minimum#classtensorflow_1_1ops_1_1_minimum)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Minimum](#classtensorflow_1_1ops_1_1_minimum_1ac4adc49798a67cf191a5deb756d98fa7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_minimum_1af0c9c2dc2932a392a4a30dc56da13f16)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_minimum_1add0714b5554238b895f86d531b850e5a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_minimum_1a50bb9da9fa970fe09f25ffc20ca41a21)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_minimum_1afe13a05bbfdb38633d5277e3d665c164)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_minimum_1aca67ef549ec1578463f5a2a898acb3b5)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Minimum
```
Minimum(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyFtrlV2 tensorflow::ops::ResourceSparseApplyFtrlV2
==========================================
`#include <training_ops.h>`
Update relevant entries in '\*var' according to the Ftrl-proximal scheme.
Summary
-------
That is for rows we have grad for, we update var, accum and linear as follows: grad\_with\_shrinkage = grad + 2 \* l2\_shrinkage \* var accum\_new = accum + grad\_with\_shrinkage \* grad\_with\_shrinkage linear += grad\_with\_shrinkage + (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 shrinkage regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyFtrlV2](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1a77306a45450ada78aafa759f7b197723)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[ResourceSparseApplyFtrlV2](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1a76e64a98f17ed91ba2513c27b045eb40)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [ResourceSparseApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1a392e0892ef99d41bc86397a57df9a98f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1afba48dacb7460dfeb6303226504eec7e)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1a6538eb563c2ac53a5b55762289706098)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1a5a50996a22963c9d267ae9f2b76fa63c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-ftrl-v2/attrs) | Optional attribute setters for [ResourceSparseApplyFtrlV2](resource-sparse-apply-ftrl-v2#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyFtrlV2
```
ResourceSparseApplyFtrlV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input l2_shrinkage,
::tensorflow::Input lr_power
)
```
### ResourceSparseApplyFtrlV2
```
ResourceSparseApplyFtrlV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input l2_shrinkage,
::tensorflow::Input lr_power,
const ResourceSparseApplyFtrlV2::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::UnicodeTranscode tensorflow::ops::UnicodeTranscode
=================================
`#include <string_ops.h>`
Transcode the input text from a source encoding to a destination encoding.
Summary
-------
The input is a string tensor of any shape. The output is a string tensor of the same shape containing the transcoded strings. [Output](../output#classtensorflow_1_1_output) strings are always valid unicode. If the input contains invalid encoding positions, the `errors` attribute sets the policy for how to deal with them. If the default error-handling policy is used, invalid formatting will be substituted in the output by the `replacement_char`. If the errors policy is to `ignore`, any invalid encoding positions in the input are skipped and not included in the output. If it set to `strict` then any invalid formatting will result in an InvalidArgument error.
This operation can be used with `output_encoding = input_encoding` to enforce correct formatting for inputs even if they are already in the desired encoding.
If the input is prefixed by a Byte Order Mark needed to determine encoding (e.g. if the encoding is UTF-16 and the BOM indicates big-endian), then that BOM will be consumed and not emitted into the output. If the input encoding is marked with an explicit endianness (e.g. UTF-16-BE), then the BOM is interpreted as a non-breaking-space and is preserved in the output (including always for UTF-8).
The end result is that if the input is marked as an explicit endianness the transcoding is faithful to all codepoints in the source. If it is not marked with an explicit endianness, the BOM is not considered part of the string itself but as metadata, and so is not preserved in the output.
Examples:
tf.strings.unicode\_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") tf.strings.unicode\_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() array([b'A', b'B', b'C'], dtype=object)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The text to be processed. Can have any shape.
* input\_encoding: Text encoding of the input strings. This is any of the encodings supported by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`.
* output\_encoding: The unicode encoding to use in the output. Must be one of `"UTF-8", "UTF-16-BE", "UTF-32-BE"`. Multi-byte encodings will be big-endian.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)`):
* errors: Error handling policy when there is invalid formatting found in the input. The value of 'strict' will cause the operation to produce a InvalidArgument error on any invalid input formatting. A value of 'replace' (the default) will cause the operation to replace any invalid formatting in the input with the `replacement_char` codepoint. A value of 'ignore' will cause the operation to skip any invalid formatting in the input and produce no corresponding output character.
* replacement\_char: The replacement character codepoint to be used in place of any invalid formatting in the input when `errors='replace'`. [Any](any#classtensorflow_1_1ops_1_1_any) valid unicode codepoint may be used. The default value is the default unicode replacement character is 0xFFFD or U+65533.)
Note that for UTF-8, passing a replacement character expressible in 1 byte, such as ' ', will preserve string alignment to the source since invalid bytes will be replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte replacement character will preserve byte alignment to the source.
* replace\_control\_characters: Whether to replace the C0 control characters (00-1F) with the `replacement_char`. Default is false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A string tensor containing unicode text encoded using `output_encoding`.
| Constructors and Destructors |
| --- |
| `[UnicodeTranscode](#classtensorflow_1_1ops_1_1_unicode_transcode_1a7f5400ef43a30cade48ec26babb8d8ac)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, StringPiece input_encoding, StringPiece output_encoding)` |
| `[UnicodeTranscode](#classtensorflow_1_1ops_1_1_unicode_transcode_1a40d3c0e8ec4a39090a41db687a75e81e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, StringPiece input_encoding, StringPiece output_encoding, const [UnicodeTranscode::Attrs](../../../struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_unicode_transcode_1a9121969d40f22188b5468ef3a88c7e85)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_unicode_transcode_1a72ea1928a722003c6a454fb3e4d99cf8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_unicode_transcode_1a5bd626fd8293b9ba38989e199cb56039)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unicode_transcode_1aa3ed5d86e608fef6fe501acc1886adc4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unicode_transcode_1a228a8c3c53116beb44e18691ba954e40)() const` | |
| Public static functions |
| --- |
| `[Errors](#classtensorflow_1_1ops_1_1_unicode_transcode_1a4ec0643c5c92c98679d67690e8d6826c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)` |
| `[ReplaceControlCharacters](#classtensorflow_1_1ops_1_1_unicode_transcode_1ac2031f1a1d602c2981d079a72e41ad8b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)` |
| `[ReplacementChar](#classtensorflow_1_1ops_1_1_unicode_transcode_1a006b666456f90b0903bcaea23ee678cd)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::UnicodeTranscode::Attrs](../../../struct/tensorflow/ops/unicode-transcode/attrs) | Optional attribute setters for [UnicodeTranscode](unicode-transcode#classtensorflow_1_1ops_1_1_unicode_transcode). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### UnicodeTranscode
```
UnicodeTranscode(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
StringPiece input_encoding,
StringPiece output_encoding
)
```
### UnicodeTranscode
```
UnicodeTranscode(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
StringPiece input_encoding,
StringPiece output_encoding,
const UnicodeTranscode::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Errors
```
Attrs Errors(
StringPiece x
)
```
### ReplaceControlCharacters
```
Attrs ReplaceControlCharacters(
bool x
)
```
### ReplacementChar
```
Attrs ReplacementChar(
int64 x
)
```
tensorflow_cpp tensorflow::ops::MaxPoolGradGrad tensorflow::ops::MaxPoolGradGrad
================================
`#include <nn_ops.h>`
Computes second-order gradients of the maxpooling function.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* orig\_input: The original input tensor.
* orig\_output: The original output tensor.
* grad: 4-D. Gradients of gradients w.r.t. the input of `max_pool`.
* ksize: The size of the window for each dimension of the input tensor.
* strides: The stride of the sliding window for each dimension of the input tensor.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Gradients of gradients w.r.t. the input to `max_pool`.
| Constructors and Destructors |
| --- |
| `[MaxPoolGradGrad](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1a624a485e1ee030cfb203f5767164e05d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPoolGradGrad](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1a105790392c03a29e7a1a93c4a25f1065)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPoolGradGrad::Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1aaced190ad09e9b1e03ba1758d3846c59)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1a1db2508c1fc12d0bbbaf034e1332e8e9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1a0a817f73310d28bd0344cba01c80d9eb)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1aa9cf85f8e08191a34aec8a97b5c7d7b5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1a85951360272d8bcb3d56b273d5e3a06a)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_1a2595c027a5b997820e1f11301e2f8e5b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPoolGradGrad::Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad/attrs) | Optional attribute setters for [MaxPoolGradGrad](max-pool-grad-grad#classtensorflow_1_1ops_1_1_max_pool_grad_grad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPoolGradGrad
```
MaxPoolGradGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input,
::tensorflow::Input orig_output,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPoolGradGrad
```
MaxPoolGradGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input,
::tensorflow::Input orig_output,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPoolGradGrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::TensorArrayGradWithShape tensorflow::ops::TensorArrayGradWithShape
=========================================
`#include <data_flow_ops.h>`
Creates a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) for storing multiple gradients of values in the given handle.
Summary
-------
Similar to TensorArrayGradV3. However it creates an accumulator with an expanded shape compared to the input [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) whose gradient is being computed. This enables multiple gradients for the same [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) to be calculated using the same accumulator.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* flow\_in: A float scalar that enforces proper chaining of operations.
* shape\_to\_prepend: An int32 vector representing a shape. Elements in the gradient accumulator will have shape which is this shape\_to\_prepend value concatenated with shape of the elements in the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) corresponding to the input handle.
* source: The gradient source string, used to decide which gradient [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) to return.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` grad\_handle
* `[Output](../output#classtensorflow_1_1_output)` flow\_out
| Constructors and Destructors |
| --- |
| `[TensorArrayGradWithShape](#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1ae957f3234c62f254b88ced73dd452371)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape_to_prepend, StringPiece source)` |
| Public attributes |
| --- |
| `[flow\_out](#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1a7e66bafef678a0c4a661598e8d61c4a3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[grad\_handle](#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1a732338604dc6b1ce0db860e97a5df6ec)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_grad_with_shape_1a0430f64eabb7fa21eac6b06e3e01ec04)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### flow\_out
```
::tensorflow::Output flow_out
```
### grad\_handle
```
::tensorflow::Output grad_handle
```
### operation
```
Operation operation
```
Public functions
----------------
### TensorArrayGradWithShape
```
TensorArrayGradWithShape(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input flow_in,
::tensorflow::Input shape_to_prepend,
StringPiece source
)
```
tensorflow_cpp tensorflow::ops::ReadFile tensorflow::ops::ReadFile
=========================
`#include <io_ops.h>`
Reads and outputs the entire contents of the input filename.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The contents tensor.
| Constructors and Destructors |
| --- |
| `[ReadFile](#classtensorflow_1_1ops_1_1_read_file_1aea66c390cb0cf3d508da628229b1c188)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filename)` |
| Public attributes |
| --- |
| `[contents](#classtensorflow_1_1ops_1_1_read_file_1a620eb4e56b7754eb0b3e9e74fea85f14)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_read_file_1adbb57ce5090cf5fcf13223912fd75401)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_read_file_1a2d9844685a0cf777facc7a04aa8cd2e7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_read_file_1a8e4b60074f25b6e8a7f68241ae52e8f2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_read_file_1ab581736a842757b578071443c884931b)() const` | |
Public attributes
-----------------
### contents
```
::tensorflow::Output contents
```
### operation
```
Operation operation
```
Public functions
----------------
### ReadFile
```
ReadFile(
const ::tensorflow::Scope & scope,
::tensorflow::Input filename
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Placeholder tensorflow::ops::Placeholder
============================
`#include <array_ops.h>`
A placeholder op for a value that will be fed into the computation.
Summary
-------
N.B. This operation will fail with an error if it is executed. It is intended as a way to represent a value that will always be fed, and to provide attrs that enable the fed value to be checked at runtime.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* dtype: The type of elements in the tensor.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/placeholder/attrs#structtensorflow_1_1ops_1_1_placeholder_1_1_attrs)`):
* shape: (Optional) The shape of the tensor. If the shape has 0 dimensions, the shape is unconstrained.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A placeholder tensor that must be replaced using the feed mechanism.
| Constructors and Destructors |
| --- |
| `[Placeholder](#classtensorflow_1_1ops_1_1_placeholder_1adb3e3d0b072d160a2df953b84093f55d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype)` |
| `[Placeholder](#classtensorflow_1_1ops_1_1_placeholder_1abb57d03cb93c356b129016dc3ff00e87)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype, const [Placeholder::Attrs](../../../struct/tensorflow/ops/placeholder/attrs#structtensorflow_1_1ops_1_1_placeholder_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_placeholder_1af4a6ff42f4dd94bf5dd37de61cea5ef0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_placeholder_1a84e658dbf37cb549c1777496b6dbe5b7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_placeholder_1a783185c82a138844a15cfc31b94d16ae)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_placeholder_1a698c9b9de24acafaccc356d925b22295)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_placeholder_1a22ddd47d22954ae354221696caf75d0b)() const` | |
| Public static functions |
| --- |
| `[Shape](#classtensorflow_1_1ops_1_1_placeholder_1a7b0844809be785ca077012ead552c73d)(PartialTensorShape x)` | `[Attrs](../../../struct/tensorflow/ops/placeholder/attrs#structtensorflow_1_1ops_1_1_placeholder_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Placeholder::Attrs](../../../struct/tensorflow/ops/placeholder/attrs) | Optional attribute setters for [Placeholder](placeholder#classtensorflow_1_1ops_1_1_placeholder). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Placeholder
```
Placeholder(
const ::tensorflow::Scope & scope,
DataType dtype
)
```
### Placeholder
```
Placeholder(
const ::tensorflow::Scope & scope,
DataType dtype,
const Placeholder::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Shape
```
Attrs Shape(
PartialTensorShape x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ParseSequenceExampleV2 tensorflow::ops::ParseSequenceExampleV2
=======================================
`#include <parsing_ops.h>`
Transforms a vector of tf.io.SequenceExample protos (as strings) into typed tensors.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A scalar or vector containing binary serialized SequenceExample protos.
* debug\_name: A scalar or vector containing the names of the serialized protos. May contain, for example, table key (descriptive) name for the corresponding serialized proto. This is purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no name is available.
* context\_sparse\_keys: The keys expected in the Examples' features associated with context\_sparse values.
* context\_dense\_keys: The keys expected in the SequenceExamples' context features associated with dense values.
* context\_ragged\_keys: The keys expected in the Examples' features associated with context\_ragged values.
* feature\_list\_sparse\_keys: The keys expected in the FeatureLists associated with sparse values.
* feature\_list\_dense\_keys: The keys expected in the SequenceExamples' feature\_lists associated with lists of dense values.
* feature\_list\_ragged\_keys: The keys expected in the FeatureLists associated with ragged values.
* feature\_list\_dense\_missing\_assumed\_empty: A vector corresponding 1:1 with feature\_list\_dense\_keys, indicating which features may be missing from the SequenceExamples. If the associated FeatureList is missing, it is treated as empty.
* context\_dense\_defaults: A list of Ncontext\_dense Tensors (some may be empty). context\_dense\_defaults[j] provides default values when the SequenceExample's context map lacks context\_dense\_key[j]. If an empty [Tensor](../tensor#classtensorflow_1_1_tensor) is provided for context\_dense\_defaults[j], then the Feature context\_dense\_keys[j] is required. The input type is inferred from context\_dense\_defaults[j], even when it's empty. If context\_dense\_defaults[j] is not empty, its shape must match context\_dense\_shapes[j].
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)`):
* context\_sparse\_types: A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. Currently the [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* context\_ragged\_value\_types: RaggedTensor.value dtypes for the ragged context features.
* context\_ragged\_split\_types: RaggedTensor.row\_split dtypes for the ragged context features.
* context\_dense\_shapes: A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. The number of elements in the Feature corresponding to context\_dense\_key[j] must always equal context\_dense\_shapes[j].NumEntries(). The shape of context\_dense\_values[j] will match context\_dense\_shapes[j].
* feature\_list\_sparse\_types: A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. Currently the [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* feature\_list\_ragged\_value\_types: RaggedTensor.value dtypes for the ragged FeatureList features.
* feature\_list\_ragged\_split\_types: RaggedTensor.row\_split dtypes for the ragged FeatureList features.
* feature\_list\_dense\_shapes: A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. The shape of each Feature in the FeatureList corresponding to feature\_list\_dense\_key[j] must always equal feature\_list\_dense\_shapes[j].NumEntries().
Returns:
* `OutputList` context\_sparse\_indices
* `OutputList` context\_sparse\_values
* `OutputList` context\_sparse\_shapes
* `OutputList` context\_dense\_values
* `OutputList` context\_ragged\_values
* `OutputList` context\_ragged\_row\_splits
* `OutputList` feature\_list\_sparse\_indices
* `OutputList` feature\_list\_sparse\_values
* `OutputList` feature\_list\_sparse\_shapes
* `OutputList` feature\_list\_dense\_values
* `OutputList` feature\_list\_dense\_lengths
* `OutputList` feature\_list\_ragged\_values
* `OutputList` feature\_list\_ragged\_outer\_splits
* `OutputList` feature\_list\_ragged\_inner\_splits
| Constructors and Destructors |
| --- |
| `[ParseSequenceExampleV2](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a31bf76ecd9b25ecf957e3c2e6fdfd84c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) debug_name, ::[tensorflow::Input](../input#classtensorflow_1_1_input) context_sparse_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) context_dense_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) context_ragged_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_sparse_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_dense_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_ragged_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_dense_missing_assumed_empty, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_defaults)` |
| `[ParseSequenceExampleV2](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a32ff784d50dd2b09d971d4657e4e89d7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) debug_name, ::[tensorflow::Input](../input#classtensorflow_1_1_input) context_sparse_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) context_dense_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) context_ragged_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_sparse_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_dense_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_ragged_keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_dense_missing_assumed_empty, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_defaults, const [ParseSequenceExampleV2::Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[context\_dense\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a97c30de31e212a94cbe893e11856ca2e)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_ragged\_row\_splits](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a3cf87435968f01ac2c8fa6b124c03089)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_ragged\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1ae4d762887dfe0ca7c2dc7db9a72d1bec)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_indices](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1ac2a113ac5244350eb3b1d770241530e1)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a7fe621c21291586c6db5ff7a713723e0)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a9a6ca48edef808466746361f8727ca2c)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_dense\_lengths](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1ac526dc1d97485099840575c30d95ffd6)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_dense\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a366d52f7cb6ae1bd6bae18c4f9f80baa)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_ragged\_inner\_splits](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a8535cf1071c870c138141958ef48cee5)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_ragged\_outer\_splits](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a2bec2d6161ebba231d5d831aa5fbd18a)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_ragged\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a1b3160cd008b43bb4fd641fb5d278133)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_indices](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a69555dcd51744568edb02d85ed6527cb)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1aacfba9d5440cbf201164ba40ddc83849)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1ac3bf3b69c02664a24643fe5608561b14)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1ad4d315df9c0d1330e2c3a97e35d033b6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[ContextDenseShapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a43a2c531afd9b845bbc8e35ec8713213)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[ContextRaggedSplitTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1acb76ea3a1e222c84c3cc828416d3463b)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[ContextRaggedValueTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a2cf288653fc8a93710aebd583b70b26d)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[ContextSparseTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a6db7d20a67fde369ae1936b231ee171d)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[FeatureListDenseShapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1ab846b9bb886246960a418aed1e6ec08f)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[FeatureListDenseTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a67be1dd3181da8e722f73feb28554112)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[FeatureListRaggedSplitTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a44352a0482f667b106970515d1b93e5a)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[FeatureListRaggedValueTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1afbe62cd271f84830946263466de25a90)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[FeatureListSparseTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a4eb5a10d1dc2ab5f776d2c76d6d9cd56)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[NcontextSparse](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a1e41da5e0e5acc2aeddc25037689a739)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[NfeatureListDense](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1a03c2e99e3fa5c880142d7902cd70f7c8)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| `[NfeatureListSparse](#classtensorflow_1_1ops_1_1_parse_sequence_example_v2_1aac9edc006f1795d9d91315835d22bb6f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ParseSequenceExampleV2::Attrs](../../../struct/tensorflow/ops/parse-sequence-example-v2/attrs) | Optional attribute setters for [ParseSequenceExampleV2](parse-sequence-example-v2#classtensorflow_1_1ops_1_1_parse_sequence_example_v2). |
Public attributes
-----------------
### context\_dense\_values
```
::tensorflow::OutputList context_dense_values
```
### context\_ragged\_row\_splits
```
::tensorflow::OutputList context_ragged_row_splits
```
### context\_ragged\_values
```
::tensorflow::OutputList context_ragged_values
```
### context\_sparse\_indices
```
::tensorflow::OutputList context_sparse_indices
```
### context\_sparse\_shapes
```
::tensorflow::OutputList context_sparse_shapes
```
### context\_sparse\_values
```
::tensorflow::OutputList context_sparse_values
```
### feature\_list\_dense\_lengths
```
::tensorflow::OutputList feature_list_dense_lengths
```
### feature\_list\_dense\_values
```
::tensorflow::OutputList feature_list_dense_values
```
### feature\_list\_ragged\_inner\_splits
```
::tensorflow::OutputList feature_list_ragged_inner_splits
```
### feature\_list\_ragged\_outer\_splits
```
::tensorflow::OutputList feature_list_ragged_outer_splits
```
### feature\_list\_ragged\_values
```
::tensorflow::OutputList feature_list_ragged_values
```
### feature\_list\_sparse\_indices
```
::tensorflow::OutputList feature_list_sparse_indices
```
### feature\_list\_sparse\_shapes
```
::tensorflow::OutputList feature_list_sparse_shapes
```
### feature\_list\_sparse\_values
```
::tensorflow::OutputList feature_list_sparse_values
```
### operation
```
Operation operation
```
Public functions
----------------
### ParseSequenceExampleV2
```
ParseSequenceExampleV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input debug_name,
::tensorflow::Input context_sparse_keys,
::tensorflow::Input context_dense_keys,
::tensorflow::Input context_ragged_keys,
::tensorflow::Input feature_list_sparse_keys,
::tensorflow::Input feature_list_dense_keys,
::tensorflow::Input feature_list_ragged_keys,
::tensorflow::Input feature_list_dense_missing_assumed_empty,
::tensorflow::InputList context_dense_defaults
)
```
### ParseSequenceExampleV2
```
ParseSequenceExampleV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input debug_name,
::tensorflow::Input context_sparse_keys,
::tensorflow::Input context_dense_keys,
::tensorflow::Input context_ragged_keys,
::tensorflow::Input feature_list_sparse_keys,
::tensorflow::Input feature_list_dense_keys,
::tensorflow::Input feature_list_ragged_keys,
::tensorflow::Input feature_list_dense_missing_assumed_empty,
::tensorflow::InputList context_dense_defaults,
const ParseSequenceExampleV2::Attrs & attrs
)
```
Public static functions
-----------------------
### ContextDenseShapes
```
Attrs ContextDenseShapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### ContextRaggedSplitTypes
```
Attrs ContextRaggedSplitTypes(
const DataTypeSlice & x
)
```
### ContextRaggedValueTypes
```
Attrs ContextRaggedValueTypes(
const DataTypeSlice & x
)
```
### ContextSparseTypes
```
Attrs ContextSparseTypes(
const DataTypeSlice & x
)
```
### FeatureListDenseShapes
```
Attrs FeatureListDenseShapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### FeatureListDenseTypes
```
Attrs FeatureListDenseTypes(
const DataTypeSlice & x
)
```
### FeatureListRaggedSplitTypes
```
Attrs FeatureListRaggedSplitTypes(
const DataTypeSlice & x
)
```
### FeatureListRaggedValueTypes
```
Attrs FeatureListRaggedValueTypes(
const DataTypeSlice & x
)
```
### FeatureListSparseTypes
```
Attrs FeatureListSparseTypes(
const DataTypeSlice & x
)
```
### NcontextSparse
```
Attrs NcontextSparse(
int64 x
)
```
### NfeatureListDense
```
Attrs NfeatureListDense(
int64 x
)
```
### NfeatureListSparse
```
Attrs NfeatureListSparse(
int64 x
)
```
tensorflow_cpp tensorflow::ops::Igamma tensorflow::ops::Igamma
=======================
`#include <math_ops.h>`
Compute the lower regularized incomplete Gamma function `P(a, x)`.
Summary
-------
The lower regularized incomplete Gamma function is defined as:
\(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\)
where
\(gamma(a, x) = \{0}^{x} t^{a-1} exp(-t) dt\)
is the lower incomplete Gamma function.
Note, above `Q(a, x)` (`[Igammac](igammac#classtensorflow_1_1ops_1_1_igammac)`) is the upper regularized complete Gamma function.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Igamma](#classtensorflow_1_1ops_1_1_igamma_1a47205e45e27ebe1d6b09daa45618933e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_igamma_1a7ecd61ef0529d2ef62c4a2e05c6b986f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_igamma_1aad97283f8f589ba0dcfc5538303d1cdc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_igamma_1a87a26af93233752dce42b1dc9ed62061)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_igamma_1a8a071a0a661ec682e3cc7ec25468448b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_igamma_1acc62c783eaf94fd7f02da5a09e5248da)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Igamma
```
Igamma(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::DataFormatDimMap tensorflow::ops::DataFormatDimMap
=================================
`#include <nn_ops.h>`
Returns the dimension index in the destination data format given the one in.
Summary
-------
the source data format.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A [Tensor](../tensor#classtensorflow_1_1_tensor) with each element as a dimension index in source data format. Must be in the range [-4, 4).
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/data-format-dim-map/attrs#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs)`):
* src\_format: source data format.
* dst\_format: destination data format.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) with each element as a dimension index in destination data format.
| Constructors and Destructors |
| --- |
| `[DataFormatDimMap](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a940ff2efc55cc98716eff22bd5169e62)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| `[DataFormatDimMap](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a777da26710837763c75921455aba5ddc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, const [DataFormatDimMap::Attrs](../../../struct/tensorflow/ops/data-format-dim-map/attrs#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a35705e5ab8f763439369ba015fe6e6dd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a238392a1475522186dd4349a086e7616)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a7e7cb21492d0b95b81e81c35c464a2f7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a9f826ae3e4dcfde21a0f3d0be8f6dd7d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a4952830e7df82cbaf6d8cae075938f89)() const` | |
| Public static functions |
| --- |
| `[DstFormat](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a5df6304afeba4726500529df347ea2f5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/data-format-dim-map/attrs#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs)` |
| `[SrcFormat](#classtensorflow_1_1ops_1_1_data_format_dim_map_1a7a5893b6eea8561444a973fc16dd7bd6)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/data-format-dim-map/attrs#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DataFormatDimMap::Attrs](../../../struct/tensorflow/ops/data-format-dim-map/attrs) | Optional attribute setters for [DataFormatDimMap](data-format-dim-map#classtensorflow_1_1ops_1_1_data_format_dim_map). |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### DataFormatDimMap
```
DataFormatDimMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### DataFormatDimMap
```
DataFormatDimMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
const DataFormatDimMap::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DstFormat
```
Attrs DstFormat(
StringPiece x
)
```
### SrcFormat
```
Attrs SrcFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::PadV2 tensorflow::ops::PadV2
======================
`#include <array_ops.h>`
Pads a tensor.
Summary
-------
This operation pads `input` according to the `paddings` and `constant_values` you specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates how many padding values to add before the contents of `input` in that dimension, and `paddings[D, 1]` indicates how many padding values to add after the contents of `input` in that dimension. `constant_values` is a scalar tensor of the same type as `input` that indicates the value to use for padding `input`.
The padded size of each dimension D of the output is:
`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`
For example:
```
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# 'constant_values' is 0
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[PadV2](#classtensorflow_1_1ops_1_1_pad_v2_1a7bfe2355f5a726124af6e6f1b824b9cb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) paddings, ::[tensorflow::Input](../input#classtensorflow_1_1_input) constant_values)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_pad_v2_1aa6b1cf71582c8eb44a33bac7b2750a55)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_pad_v2_1ad73c63310fcef6d2993c1a43c93aa7a1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_pad_v2_1a4f62d5b59022fec3a068bd2196a98891)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_pad_v2_1a74d06bca0cc72234b6a1578639fca7f5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_pad_v2_1ad0329a090a7e956fcd77489c7d27edc4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### PadV2
```
PadV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input paddings,
::tensorflow::Input constant_values
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Erfinv tensorflow::ops::Erfinv
=======================
`#include <math_ops.h>`
TODO: add doc.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Erfinv](#classtensorflow_1_1ops_1_1_erfinv_1ae70428c13edbf038871b118a01c02786)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_erfinv_1abb9a19b83eb29a5f4ba34e9ad7f0641e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_erfinv_1a8dd825be9352cfdbaefe939cf497fdbd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_erfinv_1a364fe4468ca99a23fc8cc08728b30033)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_erfinv_1a09dbfad9b0668544bb554b839431a6d1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_erfinv_1a3b6ef15e82fd748fd429eca59d8d6d7e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Erfinv
```
Erfinv(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AdjustHue tensorflow::ops::AdjustHue
==========================
`#include <image_ops.h>`
Adjust the hue of one or more images.
Summary
-------
`images` is a tensor of at least 3 dimensions. The last dimension is interpreted as channels, and must be three.
The input image is considered in the RGB colorspace. Conceptually, the RGB colors are first mapped into HSV. A delta is then applied all the hue values, and then remapped back to RGB colorspace.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: Images to adjust. At least 3-D.
* delta: A float delta to add to the hue.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The hue-adjusted image or images.
| Constructors and Destructors |
| --- |
| `[AdjustHue](#classtensorflow_1_1ops_1_1_adjust_hue_1adc4729f81b3706ecca637695791dc6e2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_adjust_hue_1ab7879385304f864560033ed8d8058438)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_adjust_hue_1a75cd3fc2cfbf2b12ad981a0d40051c95)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_adjust_hue_1ad85bc0661591d1b7ef77a485a6a782f1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_adjust_hue_1aab8668abf25375e15ea5979988b0d27b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_adjust_hue_1a68d5b5f733baafcf370f564ccc097e28)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### AdjustHue
```
AdjustHue(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input delta
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MapClear tensorflow::ops::MapClear
=========================
`#include <data_flow_ops.h>`
Op removes all elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[MapClear](#classtensorflow_1_1ops_1_1_map_clear_1abb2a7456cc08a5865a585c8f6220a10c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[MapClear](#classtensorflow_1_1ops_1_1_map_clear_1aca3d53c578e01f45917a766879fd19e8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [MapClear::Attrs](../../../struct/tensorflow/ops/map-clear/attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_map_clear_1a15d6d0e48aeb5fa0dc4986d4c8781ee1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_map_clear_1a2e99a647fe4658faa41caaa6f8da0f2a)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_clear_1a57a5f3ee2dabb4a5a90525e05b3d5b84)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-clear/attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_clear_1af2a0fae935978e1e2d9b8de81a1dc13c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-clear/attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_clear_1af03fd7a53fb5de020d8705d0e69fca96)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-clear/attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_clear_1a6d98afcc1cd43db3e2103d8673060eef)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-clear/attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapClear::Attrs](../../../struct/tensorflow/ops/map-clear/attrs) | Optional attribute setters for [MapClear](map-clear#classtensorflow_1_1ops_1_1_map_clear). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### MapClear
```
MapClear(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### MapClear
```
MapClear(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const MapClear::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::MaxPool3DGradGrad tensorflow::ops::MaxPool3DGradGrad
==================================
`#include <nn_ops.h>`
Computes second-order gradients of the maxpooling function.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* orig\_input: The original input tensor.
* orig\_output: The original output tensor.
* grad: [Output](../output#classtensorflow_1_1_output) backprop of shape `[batch, depth, rows, cols, channels]`.
* ksize: 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have `ksize[0] = ksize[4] = 1`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad-grad/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Gradients of gradients w.r.t. the input to `max_pool`.
| Constructors and Destructors |
| --- |
| `[MaxPool3DGradGrad](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1a321b0af89e0d474f1c47e1b56a901da5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPool3DGradGrad](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1a1ab771fc14377bbd003cf6a0eb96c2ad)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPool3DGradGrad::Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad-grad/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1a3df083c1b8bff3fe07b796c995dbc1f5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1aa69fe26b83a309417a0103b09488eafa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1ac2acbdab5dde8105877b14badb46ccc7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1ae8e6a0a8acc839a71d2353beb944e2fa)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1a574f83f847b22b01963e9649f6fe60f5)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1a6edaa5d5fd12c37d7a45ad75ea3719ea)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad-grad/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPool3DGradGrad::Attrs](../../../struct/tensorflow/ops/max-pool3-d-grad-grad/attrs) | Optional attribute setters for [MaxPool3DGradGrad](max-pool3-d-grad-grad#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPool3DGradGrad
```
MaxPool3DGradGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input,
::tensorflow::Input orig_output,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPool3DGradGrad
```
MaxPool3DGradGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input orig_input,
::tensorflow::Input orig_output,
::tensorflow::Input grad,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPool3DGradGrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::DecodePng tensorflow::ops::DecodePng
==========================
`#include <image_ops.h>`
Decode a PNG-encoded image to a uint8 or uint16 tensor.
Summary
-------
The attr `channels` indicates the desired number of color channels for the decoded image.
Accepted values are:
* 0: Use the number of channels in the PNG-encoded image.
* 1: output a grayscale image.
* 3: output an RGB image.
* 4: output an RGBA image.
If needed, the PNG-encoded image is transformed to match the requested number of color channels.
This op also supports decoding JPEGs and non-animated GIFs since the interface is the same, though it is cleaner to use `tf.io.decode_image`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* contents: 0-D. The PNG-encoded image.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)`):
* channels: Number of color channels for the decoded image.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D with shape `[height, width, channels]`.
| Constructors and Destructors |
| --- |
| `[DecodePng](#classtensorflow_1_1ops_1_1_decode_png_1ab7adeeb5aa6b10893fb6063ee8d6fc87)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| `[DecodePng](#classtensorflow_1_1ops_1_1_decode_png_1aa2df55e8e1eed056df69f127ca4cba25)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, const [DecodePng::Attrs](../../../struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[image](#classtensorflow_1_1ops_1_1_decode_png_1a493e0f58c502e83895b5ab8df3ed277c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_decode_png_1ac11da6e89a194ee86e7a82442fb33ed4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_png_1adea6247b44969accb1513a6b237bd2d3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_png_1a1449fe5081528b4cb081cb224ba20d96)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_png_1a19025343d7746c9091afcf01dbba03fd)() const` | |
| Public static functions |
| --- |
| `[Channels](#classtensorflow_1_1ops_1_1_decode_png_1ac0322c095dfd2d11bca81c46b421847a)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)` |
| `[Dtype](#classtensorflow_1_1ops_1_1_decode_png_1a656dedb17c75247c916d54efef9fb4f6)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/decode-png/attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodePng::Attrs](../../../struct/tensorflow/ops/decode-png/attrs) | Optional attribute setters for [DecodePng](decode-png#classtensorflow_1_1ops_1_1_decode_png). |
Public attributes
-----------------
### image
```
::tensorflow::Output image
```
### operation
```
Operation operation
```
Public functions
----------------
### DecodePng
```
DecodePng(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents
)
```
### DecodePng
```
DecodePng(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents,
const DecodePng::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Channels
```
Attrs Channels(
int64 x
)
```
### Dtype
```
Attrs Dtype(
DataType x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::StringToHashBucketStrong tensorflow::ops::StringToHashBucketStrong
=========================================
`#include <string_ops.h>`
Converts each string in the input [Tensor](../tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets.
Summary
-------
The hash function is deterministic on the content of the string within the process. The hash function is a keyed hash function, where attribute `key` defines the key of the hash function. `key` is an array of 2 elements.
A strong hash is important when inputs may be malicious, e.g. URLs with additional components. Adversaries could try to make their inputs hash to the same bucket for a denial-of-service attack or to skew the results. A strong hash can be used to make it difficult to find inputs with a skewed hash value distribution over buckets. This requires that the hash function is seeded by a high-entropy (random) "key" unknown to the adversary.
The additional robustness comes at a cost of roughly 4x higher compute time than `tf.string_to_hash_bucket_fast`.
Examples:
tf.strings.to\_hash\_bucket\_strong(["Hello", "TF"], 3, [1, 2]).numpy() array([2, 0])
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The strings to assign a hash bucket.
* num\_buckets: The number of buckets.
* key: The key used to seed the hash function, passed as a list of two uint64 elements.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) of the same shape as the input `string_tensor`.
| Constructors and Destructors |
| --- |
| `[StringToHashBucketStrong](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_strong_1ac875272a421c27022485c1d156921526)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, int64 num_buckets, const gtl::ArraySlice< int > & key)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_strong_1a6ef732f172d70e59235f3e6ede12b13a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_strong_1a2b2f736fdbc1add249f1a4dfd72ab6dd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_strong_1a2f2541ad755307573080aaaba9d46e52)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_strong_1adf2f87bf8defcccf0aa91ddf87b3a2e5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_strong_1a5549b421caa8118777e62a2538e604f9)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringToHashBucketStrong
```
StringToHashBucketStrong(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
int64 num_buckets,
const gtl::ArraySlice< int > & key
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel
==================================================
`#include <array_ops.h>`
Fake-quantize the 'inputs' tensor of type float via per-channel floats.
Summary
-------
Fake-quantize the `inputs` tensor of type float per-channel and one of the shapes: `[d]`, `[b, d]``[b, h, w, d]` via per-channel floats `min` and `max` of shape `[d]` to `outputs` tensor of same shape as `inputs`.
Attributes
* `[min; max]` define the clamping range for the `inputs` data.
* `inputs` values are quantized into the quantization range ( `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` when it is true) and then de-quantized and output as floats in `[min; max]` interval.
* `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive.
Before quantization, `min` and `max` values are adjusted with the following logic. It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, the behavior can be unexpected:
* If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`.
* If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`.
* If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1)`, `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`.
This operation has a gradient and thus allows for training `min` and `max` values.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The outputs tensor.
| Constructors and Destructors |
| --- |
| `[FakeQuantWithMinMaxVarsPerChannel](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a6030177a230ce0707cc84d79780582a9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max)` |
| `[FakeQuantWithMinMaxVarsPerChannel](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a757ed99cef8d6918b36881c63b277e37)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max, const [FakeQuantWithMinMaxVarsPerChannel::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1aa47fa159b050ba6248ed92fab3b37c71)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[outputs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a045da04027810b223dfcd856f1a5aeb6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a8b5095141e6cd70ed955461ded03fed9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1ac20c09de7bf22ed92c3c4e8779c91731)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a1e190c4077dd2fc0e08d472ac85d044e)() const` | |
| Public static functions |
| --- |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a8988bcb74e45c0d5741dc23d48ff4218)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1a8e692f7bad00eea0472c6e277b38ca89)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-per-channel/attrs) | Optional attribute setters for [FakeQuantWithMinMaxVarsPerChannel](fake-quant-with-min-max-vars-per-channel#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel). |
Public attributes
-----------------
### operation
```
Operation operation
```
### outputs
```
::tensorflow::Output outputs
```
Public functions
----------------
### FakeQuantWithMinMaxVarsPerChannel
```
FakeQuantWithMinMaxVarsPerChannel(
const ::tensorflow::Scope & scope,
::tensorflow::Input inputs,
::tensorflow::Input min,
::tensorflow::Input max
)
```
### FakeQuantWithMinMaxVarsPerChannel
```
FakeQuantWithMinMaxVarsPerChannel(
const ::tensorflow::Scope & scope,
::tensorflow::Input inputs,
::tensorflow::Input min,
::tensorflow::Input max,
const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
tensorflow_cpp tensorflow::ops::RandomNormal tensorflow::ops::RandomNormal
=============================
`#include <random_ops.h>`
Outputs random values from a normal distribution.
Summary
-------
The generated values will have mean 0 and standard deviation 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: The shape of the output tensor.
* dtype: The type of the output.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-normal/attrs#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor of the specified shape filled with random normal values.
| Constructors and Destructors |
| --- |
| `[RandomNormal](#classtensorflow_1_1ops_1_1_random_normal_1a7b41dc701cdee57b719f6abecd04670e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype)` |
| `[RandomNormal](#classtensorflow_1_1ops_1_1_random_normal_1a64b0e935c4c1d4a47c6f986121add84c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype, const [RandomNormal::Attrs](../../../struct/tensorflow/ops/random-normal/attrs#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_random_normal_1ac47fd518b235cd1e014afceb66d7f306)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_random_normal_1a02c28c9d84b4b07ca4e80b016da0ecd4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_normal_1a1a40dd145b64991a7d58c8048c78ebba)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_normal_1a87b2066f673bc74872fe7646084dd9ae)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_normal_1a21f1b07cb82b038ec549d30297ba37a0)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_random_normal_1adcde4468e983c17b0051ecad4c5c3cd6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-normal/attrs#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_normal_1a72ff9c5ac216023bca9894fe971ed85b)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-normal/attrs#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomNormal::Attrs](../../../struct/tensorflow/ops/random-normal/attrs) | Optional attribute setters for [RandomNormal](random-normal#classtensorflow_1_1ops_1_1_random_normal). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RandomNormal
```
RandomNormal(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype
)
```
### RandomNormal
```
RandomNormal(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype,
const RandomNormal::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ScatterSub tensorflow::ops::ScatterSub
===========================
`#include <state_ops.h>`
Subtracts sparse updates to a variable reference.
Summary
-------
```
# Scalar indices
ref[indices, ...] -= updates[...]
```
```
# Vector indices (for each i)
ref[indices[i], ...] -= updates[i, ...]
```
```
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
```
This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.
Duplicate entries are handled correctly: if multiple `indices` reference the same location, their (negated) contributions add.
Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* indices: A tensor of indices into the first dimension of `ref`.
* updates: A tensor of updated values to subtract from `ref`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-sub/attrs#structtensorflow_1_1ops_1_1_scatter_sub_1_1_attrs)`):
* use\_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterSub](#classtensorflow_1_1ops_1_1_scatter_sub_1accaab23798d80024fa163b041b28ae18)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterSub](#classtensorflow_1_1ops_1_1_scatter_sub_1a0d58697c440de66d32011584d4d4af87)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterSub::Attrs](../../../struct/tensorflow/ops/scatter-sub/attrs#structtensorflow_1_1ops_1_1_scatter_sub_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_sub_1a12da77ac1285712dafa533731f8a25a3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_sub_1a221096081c7f88c41de070a63a7c6206)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_sub_1a229e4f7695697fba5ea0443cf57de69c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_sub_1a20dec89b2f16e8219e280739f90678f6)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_sub_1a5b7275f0d303f4e35e97b6ebe31c1e94)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_sub_1aed39a07ee7c54561389ae9de845cb5ee)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-sub/attrs#structtensorflow_1_1ops_1_1_scatter_sub_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterSub::Attrs](../../../struct/tensorflow/ops/scatter-sub/attrs) | Optional attribute setters for [ScatterSub](scatter-sub#classtensorflow_1_1ops_1_1_scatter_sub). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterSub
```
ScatterSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterSub
```
ScatterSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterSub::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyAdagrad tensorflow::ops::ResourceSparseApplyAdagrad
===========================================
`#include <training_ops.h>`
Update relevant entries in '\*var' and '\*accum' according to the adagrad scheme.
Summary
-------
That is for rows we have grad for, we update var and accum as follows: accum += grad \* grad var -= lr \* grad \* (1 / sqrt(accum))
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyAdagrad](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1a3ecfebc42a69601af17e27c4f487996a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[ResourceSparseApplyAdagrad](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1a88b42cc212cd10a0b52d433a9116ee59)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [ResourceSparseApplyAdagrad::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1a917b533fe528936609ff652edec54b97)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1ab312e9a5253a41e2d2a895f9c50a9b17)() const` | |
| Public static functions |
| --- |
| `[UpdateSlots](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1a8e0a9ebe58e73522e657cd3fa6d2f4e1)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1ab305f9b0860b1d2a24a1d314d486ed82)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyAdagrad::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad/attrs) | Optional attribute setters for [ResourceSparseApplyAdagrad](resource-sparse-apply-adagrad#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyAdagrad
```
ResourceSparseApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### ResourceSparseApplyAdagrad
```
ResourceSparseApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
const ResourceSparseApplyAdagrad::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UpdateSlots
```
Attrs UpdateSlots(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ParseSingleSequenceExample tensorflow::ops::ParseSingleSequenceExample
===========================================
`#include <parsing_ops.h>`
Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A scalar containing a binary serialized SequenceExample proto.
* feature\_list\_dense\_missing\_assumed\_empty: A vector listing the FeatureList keys which may be missing from the SequenceExample. If the associated FeatureList is missing, it is treated as empty. By default, any FeatureList not listed in this vector must exist in the SequenceExample.
* context\_sparse\_keys: A list of Ncontext\_sparse string Tensors (scalars). The keys expected in the Examples' features associated with context\_sparse values.
* context\_dense\_keys: A list of Ncontext\_dense string Tensors (scalars). The keys expected in the SequenceExamples' context features associated with dense values.
* feature\_list\_sparse\_keys: A list of Nfeature\_list\_sparse string Tensors (scalars). The keys expected in the FeatureLists associated with sparse values.
* feature\_list\_dense\_keys: A list of Nfeature\_list\_dense string Tensors (scalars). The keys expected in the SequenceExamples' feature\_lists associated with lists of dense values.
* context\_dense\_defaults: A list of Ncontext\_dense Tensors (some may be empty). context\_dense\_defaults[j] provides default values when the SequenceExample's context map lacks context\_dense\_key[j]. If an empty [Tensor](../tensor#classtensorflow_1_1_tensor) is provided for context\_dense\_defaults[j], then the Feature context\_dense\_keys[j] is required. The input type is inferred from context\_dense\_defaults[j], even when it's empty. If context\_dense\_defaults[j] is not empty, its shape must match context\_dense\_shapes[j].
* debug\_name: A scalar containing the name of the serialized proto. May contain, for example, table key (descriptive) name for the corresponding serialized proto. This is purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty scalar if no name is available.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)`):
* context\_sparse\_types: A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. Currently the [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* context\_dense\_shapes: A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. The number of elements in the Feature corresponding to context\_dense\_key[j] must always equal context\_dense\_shapes[j].NumEntries(). The shape of context\_dense\_values[j] will match context\_dense\_shapes[j].
* feature\_list\_sparse\_types: A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. Currently the [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* feature\_list\_dense\_shapes: A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. The shape of each Feature in the FeatureList corresponding to feature\_list\_dense\_key[j] must always equal feature\_list\_dense\_shapes[j].NumEntries().
Returns:
* `OutputList` context\_sparse\_indices
* `OutputList` context\_sparse\_values
* `OutputList` context\_sparse\_shapes
* `OutputList` context\_dense\_values
* `OutputList` feature\_list\_sparse\_indices
* `OutputList` feature\_list\_sparse\_values
* `OutputList` feature\_list\_sparse\_shapes
* `OutputList` feature\_list\_dense\_values
| Constructors and Destructors |
| --- |
| `[ParseSingleSequenceExample](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1ac7bba7ef539d05fd7bbe9c0a06d72dba)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_dense_missing_assumed_empty, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_sparse_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) feature_list_sparse_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) feature_list_dense_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_defaults, ::[tensorflow::Input](../input#classtensorflow_1_1_input) debug_name)` |
| `[ParseSingleSequenceExample](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a0d7a6f18c0e133ab005ca316228dd7c1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) feature_list_dense_missing_assumed_empty, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_sparse_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) feature_list_sparse_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) feature_list_dense_keys, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_defaults, ::[tensorflow::Input](../input#classtensorflow_1_1_input) debug_name, const [ParseSingleSequenceExample::Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[context\_dense\_values](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a00b412f54367f9227341e1f20446e267)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_indices](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a7452da3688a6d5818512a2b1155f01f8)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a3966ed11f6ca309728b28dc3b904db61)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_values](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1abf42aa93aeac33f820349c146757691f)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_dense\_values](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a9fb02f3580787d1a2e9f6055aa9e8abb)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_indices](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a0625c81fc8ae456689d9a7c479195bad)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a2788a9a2e34218ad96266ffe0d2a96d3)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_values](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1adb59e03925b0c8679790edbbe5099eb4)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1adeca311e9224fb95f0e1c6c411ba34d5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[ContextDenseShapes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1ac8cad12068807119308bf5bbb8f84511)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` |
| `[ContextSparseTypes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a49f460d78ce1b2598bf8e6908c3452a4)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` |
| `[FeatureListDenseShapes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1a18fedea0dda2a6e1ebbd57a6e5585b54)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` |
| `[FeatureListDenseTypes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1ab4ab995b030e705feb362fa544378e51)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` |
| `[FeatureListSparseTypes](#classtensorflow_1_1ops_1_1_parse_single_sequence_example_1ad81b12583bebc24f425c699a97e605e2)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ParseSingleSequenceExample::Attrs](../../../struct/tensorflow/ops/parse-single-sequence-example/attrs) | Optional attribute setters for [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example). |
Public attributes
-----------------
### context\_dense\_values
```
::tensorflow::OutputList context_dense_values
```
### context\_sparse\_indices
```
::tensorflow::OutputList context_sparse_indices
```
### context\_sparse\_shapes
```
::tensorflow::OutputList context_sparse_shapes
```
### context\_sparse\_values
```
::tensorflow::OutputList context_sparse_values
```
### feature\_list\_dense\_values
```
::tensorflow::OutputList feature_list_dense_values
```
### feature\_list\_sparse\_indices
```
::tensorflow::OutputList feature_list_sparse_indices
```
### feature\_list\_sparse\_shapes
```
::tensorflow::OutputList feature_list_sparse_shapes
```
### feature\_list\_sparse\_values
```
::tensorflow::OutputList feature_list_sparse_values
```
### operation
```
Operation operation
```
Public functions
----------------
### ParseSingleSequenceExample
```
ParseSingleSequenceExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input feature_list_dense_missing_assumed_empty,
::tensorflow::InputList context_sparse_keys,
::tensorflow::InputList context_dense_keys,
::tensorflow::InputList feature_list_sparse_keys,
::tensorflow::InputList feature_list_dense_keys,
::tensorflow::InputList context_dense_defaults,
::tensorflow::Input debug_name
)
```
### ParseSingleSequenceExample
```
ParseSingleSequenceExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input feature_list_dense_missing_assumed_empty,
::tensorflow::InputList context_sparse_keys,
::tensorflow::InputList context_dense_keys,
::tensorflow::InputList feature_list_sparse_keys,
::tensorflow::InputList feature_list_dense_keys,
::tensorflow::InputList context_dense_defaults,
::tensorflow::Input debug_name,
const ParseSingleSequenceExample::Attrs & attrs
)
```
Public static functions
-----------------------
### ContextDenseShapes
```
Attrs ContextDenseShapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### ContextSparseTypes
```
Attrs ContextSparseTypes(
const DataTypeSlice & x
)
```
### FeatureListDenseShapes
```
Attrs FeatureListDenseShapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### FeatureListDenseTypes
```
Attrs FeatureListDenseTypes(
const DataTypeSlice & x
)
```
### FeatureListSparseTypes
```
Attrs FeatureListSparseTypes(
const DataTypeSlice & x
)
```
tensorflow_cpp tensorflow::ops::Variable tensorflow::ops::Variable
=========================
`#include <state_ops.h>`
Holds state in the form of a tensor that persists across steps.
Summary
-------
Outputs a ref to the tensor state so it may be read or modified. TODO(zhifengc/mrry): Adds a pointer to a more detail document about sharing states in tensorflow.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: The shape of the variable tensor.
* dtype: The type of elements in the variable tensor.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)`):
* container: If non-empty, this variable is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this variable is named in the given bucket with this shared\_name. Otherwise, the node name is used instead.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A reference to the variable tensor.
| Constructors and Destructors |
| --- |
| `[Variable](#classtensorflow_1_1ops_1_1_variable_1af0402912fc9605aef0d837283ca95251)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, PartialTensorShape shape, DataType dtype)` |
| `[Variable](#classtensorflow_1_1ops_1_1_variable_1a838420f5a738df6e954620d76ead19b3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, PartialTensorShape shape, DataType dtype, const [Variable::Attrs](../../../struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_variable_1ac6e1c46400dc4348423b98ab9555b44f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[ref](#classtensorflow_1_1ops_1_1_variable_1a22544a8c4cc8ca5250d9d91eb73563f2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_variable_1a4ab4f0408562846875bd4b320f1a78f5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_variable_1a09c4715d4048cfcc9522d1d6e496ddfe)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_variable_1a28b2d6e24ae536d8375af583a380f7bb)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_variable_1a11918e4a4bb8a9c53eb5d8b3c01b39db)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_variable_1a38a30153444617338e1c943515b1483a)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/variable/attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Variable::Attrs](../../../struct/tensorflow/ops/variable/attrs) | Optional attribute setters for [Variable](variable#classtensorflow_1_1ops_1_1_variable). |
Public attributes
-----------------
### operation
```
Operation operation
```
### ref
```
::tensorflow::Output ref
```
Public functions
----------------
### Variable
```
Variable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype
)
```
### Variable
```
Variable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype,
const Variable::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::QuantizedMaxPool tensorflow::ops::QuantizedMaxPool
=================================
`#include <nn_ops.h>`
Produces the max pool of the input tensor for quantized types.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The 4D (batch x rows x cols x depth) [Tensor](../tensor#classtensorflow_1_1_tensor) to MaxReduce over.
* min\_input: The float value that the lowest quantized input value represents.
* max\_input: The float value that the highest quantized input value represents.
* ksize: The size of the window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
* strides: The stride of the sliding window for each dimension of the input tensor. The length must be 4 to match the number of dimensions of the input.
* padding: The type of padding algorithm to use.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output
* `[Output](../output#classtensorflow_1_1_output)` min\_output: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_output: The float value that the highest quantized output value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedMaxPool](#classtensorflow_1_1ops_1_1_quantized_max_pool_1a817be0a7d6031a29bfef90a7f6023303)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| Public attributes |
| --- |
| `[max\_output](#classtensorflow_1_1ops_1_1_quantized_max_pool_1a449b1e9df9edeb0d3e25f5278613d66b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_output](#classtensorflow_1_1ops_1_1_quantized_max_pool_1a27a311ff8aac56151f4ca19baf971c7d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_max_pool_1a1321affccc07bb31594f255110100b82)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantized_max_pool_1a00495fa3c67e8252fa428cdd47740e3d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### max\_output
```
::tensorflow::Output max_output
```
### min\_output
```
::tensorflow::Output min_output
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizedMaxPool
```
QuantizedMaxPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input min_input,
::tensorflow::Input max_input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
tensorflow_cpp tensorflow::ops::AsString tensorflow::ops::AsString
=========================
`#include <string_ops.h>`
Converts each entry in the given tensor to strings.
Summary
-------
Supports many numeric types and boolean.
For Unicode, see the [<https://www.tensorflow.org/tutorials/representation/unicode>](Working with Unicode text) tutorial.
Examples:
tf.strings.as\_string([3, 2]) tf.strings.as\_string([3.1415926, 2.71828], precision=2).numpy() array([b'3.14', b'2.72'], dtype=object)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)`):
* precision: The post-decimal precision to use for floating point numbers. Only used if precision > -1.
* scientific: Use scientific notation for floating point numbers.
* shortest: Use shortest representation (either scientific or standard) for floating point numbers.
* width: [Pad](pad#classtensorflow_1_1ops_1_1_pad) pre-decimal numbers to this width. Applies to both floating point and integer numbers. Only used if width > -1.
* fill: The value to pad if width > -1. If empty, pads with spaces. Another typical value is '0'. String cannot be longer than 1 character.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[AsString](#classtensorflow_1_1ops_1_1_as_string_1a93703cfbec4867fde47aa2259770786d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[AsString](#classtensorflow_1_1ops_1_1_as_string_1a48e83706cffb25050240d9ae8e2d84e4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [AsString::Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_as_string_1a4f40ee7fcae884138385d66946669132)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_as_string_1afd5f84ceab758a320b25af91eb1614ff)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_as_string_1abb163457f3457bfe14dd5192aeced5c5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_as_string_1a25d4641309fe3d0f801105ad0b3027be)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_as_string_1a0b6fa38b640976c2d6651a9a96ae9fec)() const` | |
| Public static functions |
| --- |
| `[Fill](#classtensorflow_1_1ops_1_1_as_string_1ac3d8aab67abdc6322377e5d914aa3124)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` |
| `[Precision](#classtensorflow_1_1ops_1_1_as_string_1aa3a1688f03e1afc119452b92d96054ff)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` |
| `[Scientific](#classtensorflow_1_1ops_1_1_as_string_1a258997efffeb32c7733aaeef5f6b3614)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` |
| `[Shortest](#classtensorflow_1_1ops_1_1_as_string_1acfa9078d608f2939a48684fbf6607558)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` |
| `[Width](#classtensorflow_1_1ops_1_1_as_string_1a5c6d3289fae480ee2909b51f14351bf5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AsString::Attrs](../../../struct/tensorflow/ops/as-string/attrs) | Optional attribute setters for [AsString](as-string#classtensorflow_1_1ops_1_1_as_string). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### AsString
```
AsString(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### AsString
```
AsString(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const AsString::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Fill
```
Attrs Fill(
StringPiece x
)
```
### Precision
```
Attrs Precision(
int64 x
)
```
### Scientific
```
Attrs Scientific(
bool x
)
```
### Shortest
```
Attrs Shortest(
bool x
)
```
### Width
```
Attrs Width(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::RandomShuffle tensorflow::ops::RandomShuffle
==============================
`#include <random_ops.h>`
Randomly shuffles a tensor along its first dimension.
Summary
-------
The tensor is shuffled along dimension 0, such that each `value[j]` is mapped to one and only one `output[i]`. For example, a mapping that might occur for a 3x2 tensor is:
```
[[1, 2], [[5, 6],
[3, 4], ==> [1, 2],
[5, 6]] [3, 4]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* value: The tensor to be shuffled.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor of same shape and type as `value`, shuffled along its first dimension.
| Constructors and Destructors |
| --- |
| `[RandomShuffle](#classtensorflow_1_1ops_1_1_random_shuffle_1a85aad10494a449f347a9190a38280283)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` |
| `[RandomShuffle](#classtensorflow_1_1ops_1_1_random_shuffle_1abc84e7abae1c06e33c057531d633d13d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const [RandomShuffle::Attrs](../../../struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_random_shuffle_1ad2db7b1173c07d36b1a6861b104d12a4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_random_shuffle_1aa615db4848868b8d11a3ca57176b23be)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_shuffle_1a85dbb40592105d985cc361386d997fba)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_shuffle_1a8e09a4698ab0eee0183927b971046024)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_shuffle_1a3c9d49616ac6d2149f729063a3d8ad4f)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_random_shuffle_1a1ea6f68c5b00c8be84eca3aa1a825a7f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_shuffle_1a7cfb648b8a16f9e12113b7393ec0fde5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomShuffle::Attrs](../../../struct/tensorflow/ops/random-shuffle/attrs) | Optional attribute setters for [RandomShuffle](random-shuffle#classtensorflow_1_1ops_1_1_random_shuffle). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RandomShuffle
```
RandomShuffle(
const ::tensorflow::Scope & scope,
::tensorflow::Input value
)
```
### RandomShuffle
```
RandomShuffle(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const RandomShuffle::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::Ceil tensorflow::ops::Ceil
=====================
`#include <math_ops.h>`
Returns element-wise smallest integer not less than x.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Ceil](#classtensorflow_1_1ops_1_1_ceil_1a362b8ac6e1b4c08388aa7352f2bd2243)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ceil_1a66ad18bef9dfc04dd157ec3201976dfe)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_ceil_1a9c9af68eb13d8ff2f68506a6e526461b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ceil_1a78e247c542f51821bdb9f22d5609c0db)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ceil_1aca37283421ce697736eeb32228631de2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ceil_1af775d1ac072a8272a7d1ff54437fd785)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Ceil
```
Ceil(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DenseBincount tensorflow::ops::DenseBincount
==============================
`#include <math_ops.h>`
Counts the number of occurrences of each value in an integer array.
Summary
-------
Outputs a vector with length `size` and the same dtype as `weights`. If `weights` are empty, then index `i` stores the number of times the value `i` is counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of the value in `weights` at each index where the corresponding value in `arr` is `i`.
Values in `arr` outside of the range [0, size) are ignored.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 1D or 2D int `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* size: non-negative int scalar `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* weights: is an int32, int64, float32, or float64 `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as `arr`, or a length-0 `[Tensor](../tensor#classtensorflow_1_1_tensor)`, in which case it acts as all weights equal to 1.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/dense-bincount/attrs#structtensorflow_1_1ops_1_1_dense_bincount_1_1_attrs)`):
* binary\_output: bool; Whether the kernel should count the appearance or number of occurrences.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with length equal to `size` or 2D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with [batch\_size, `size`]. The counts or summed weights for each value in the range [0, size).
| Constructors and Destructors |
| --- |
| `[DenseBincount](#classtensorflow_1_1ops_1_1_dense_bincount_1ab02953a432ff72a2a17beaf962267085)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights)` |
| `[DenseBincount](#classtensorflow_1_1ops_1_1_dense_bincount_1a35f740d0e88d21d9fda3f036ab191f5f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights, const [DenseBincount::Attrs](../../../struct/tensorflow/ops/dense-bincount/attrs#structtensorflow_1_1ops_1_1_dense_bincount_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_dense_bincount_1a530c866f76f77857645c04629ff95f0f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_dense_bincount_1a72cd36e267012d1fba1f52d9fc5dbdde)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_dense_bincount_1afe5ba5aab8439e56df2cb121e22cdab4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_dense_bincount_1ae0ec3cf397401ec119f7a80af6b90207)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_dense_bincount_1a094e2333d7032966f32eeba7350a532c)() const` | |
| Public static functions |
| --- |
| `[BinaryOutput](#classtensorflow_1_1ops_1_1_dense_bincount_1ade99d480052f18d963d715c56162434b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/dense-bincount/attrs#structtensorflow_1_1ops_1_1_dense_bincount_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DenseBincount::Attrs](../../../struct/tensorflow/ops/dense-bincount/attrs) | Optional attribute setters for [DenseBincount](dense-bincount#classtensorflow_1_1ops_1_1_dense_bincount). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DenseBincount
```
DenseBincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input size,
::tensorflow::Input weights
)
```
### DenseBincount
```
DenseBincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input size,
::tensorflow::Input weights,
const DenseBincount::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### BinaryOutput
```
Attrs BinaryOutput(
bool x
)
```
tensorflow_cpp tensorflow::ops::DecodePaddedRaw tensorflow::ops::DecodePaddedRaw
================================
`#include <parsing_ops.h>`
Reinterpret the bytes of a string as a vector of numbers.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_bytes: [Tensor](../tensor#classtensorflow_1_1_tensor) of string to be decoded.
* fixed\_length: Length in bytes for each element of the decoded output. Must be a multiple of the size of the output type.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-padded-raw/attrs#structtensorflow_1_1ops_1_1_decode_padded_raw_1_1_attrs)`):
* little\_endian: Whether the input `input_bytes` is in little-endian order. Ignored for `out_type` values that are stored in a single byte, like `uint8`
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) with one more dimension than the input `bytes`. The added dimension will have size equal to the length of the elements of `bytes` divided by the number of bytes to represent `out_type`.
| Constructors and Destructors |
| --- |
| `[DecodePaddedRaw](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a94183df5bdaedc1b310e9ea130b6307e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_bytes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) fixed_length, DataType out_type)` |
| `[DecodePaddedRaw](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a66932ca392b545de06ef001a96c15905)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_bytes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) fixed_length, DataType out_type, const [DecodePaddedRaw::Attrs](../../../struct/tensorflow/ops/decode-padded-raw/attrs#structtensorflow_1_1ops_1_1_decode_padded_raw_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a29f4a01fa9cc61a7e4df40f8a22ca1bb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a9c2c7dbf7b377847e5a78d67e0cec014)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a12c5000831086d93709e38a378183832)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a6ec3864a3eefba01c1aa3675343e5fd5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_padded_raw_1a6bbda4013c115a1adf52cdfda9610dc7)() const` | |
| Public static functions |
| --- |
| `[LittleEndian](#classtensorflow_1_1ops_1_1_decode_padded_raw_1ab9637f01ff5433b8d35f31d306d7b91c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-padded-raw/attrs#structtensorflow_1_1ops_1_1_decode_padded_raw_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodePaddedRaw::Attrs](../../../struct/tensorflow/ops/decode-padded-raw/attrs) | Optional attribute setters for [DecodePaddedRaw](decode-padded-raw#classtensorflow_1_1ops_1_1_decode_padded_raw). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DecodePaddedRaw
```
DecodePaddedRaw(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_bytes,
::tensorflow::Input fixed_length,
DataType out_type
)
```
### DecodePaddedRaw
```
DecodePaddedRaw(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_bytes,
::tensorflow::Input fixed_length,
DataType out_type,
const DecodePaddedRaw::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### LittleEndian
```
Attrs LittleEndian(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseApplyAdagradDA tensorflow::ops::SparseApplyAdagradDA
=====================================
`#include <training_ops.h>`
Update entries in '\*var' and '\*accum' according to the proximal adagrad scheme.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* gradient\_accumulator: Should be from a Variable().
* gradient\_squared\_accumulator: Should be from a Variable().
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* lr: Learning rate. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* global\_step: Training step number. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyAdagradDA](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1afb1971e3dbb0f4a487a6069c9fdb15ee)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step)` |
| `[SparseApplyAdagradDA](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1a61642fb9a5da48aa72a60bc248dd3e03)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step, const [SparseApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1a79d811cc083567eda56a62699a3a737c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1ae2d982a56df04499e51fd2bcd4d2eaf1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1ade2e4f81a3f15e8fcf846c76a6755f95)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1a9eca1ddc2bc2bfeb6b52f0381ded7681)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1a2294c61087c20e5f137686b036811953)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1a4c35b958f9150ddc168dc9c52e2b743e)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad-d-a/attrs) | Optional attribute setters for [SparseApplyAdagradDA](sparse-apply-adagrad-d-a#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyAdagradDA
```
SparseApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step
)
```
### SparseApplyAdagradDA
```
SparseApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step,
const SparseApplyAdagradDA::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::AccumulatorTakeGradient tensorflow::ops::AccumulatorTakeGradient
========================================
`#include <data_flow_ops.h>`
Extracts the average gradient in the given [ConditionalAccumulator](conditional-accumulator#classtensorflow_1_1ops_1_1_conditional_accumulator).
Summary
-------
The op blocks until sufficient (i.e., more than num\_required) gradients have been accumulated. If the accumulator has already aggregated more than num\_required gradients, it returns the average of the accumulated gradients. Also automatically increments the recorded global\_step in the accumulator by 1, and resets the aggregate to 0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to an accumulator.
* num\_required: Number of gradients required before we return an aggregate.
* dtype: The data type of accumulated gradients. Needs to correspond to the type of the accumulator.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The average of the accumulated gradients.
| Constructors and Destructors |
| --- |
| `[AccumulatorTakeGradient](#classtensorflow_1_1ops_1_1_accumulator_take_gradient_1aa27a3882d95f8195f213544f6fd29377)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_required, DataType dtype)` |
| Public attributes |
| --- |
| `[average](#classtensorflow_1_1ops_1_1_accumulator_take_gradient_1acc0ea8ac4a347e3dfdfc93275381e25b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_accumulator_take_gradient_1a4ded4bd0ecb0059a992e4df09f133072)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_accumulator_take_gradient_1a45091b659ff109f115c9cd566637eee5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_accumulator_take_gradient_1a86cb9d0b71e04162e4177239a36ca5dc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_accumulator_take_gradient_1a9fd3cd7a27d7feb9205fc5e965479885)() const` | |
Public attributes
-----------------
### average
```
::tensorflow::Output average
```
### operation
```
Operation operation
```
Public functions
----------------
### AccumulatorTakeGradient
```
AccumulatorTakeGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input num_required,
DataType dtype
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseApplyMomentum tensorflow::ops::SparseApplyMomentum
====================================
`#include <training_ops.h>`
Update relevant entries in '\*var' and '\*accum' according to the momentum scheme.
Summary
-------
Set use\_nesterov = True if you want to use Nesterov momentum.
That is for rows we have grad for, we update var and accum as follows:
$$accum = accum \* momentum + grad$$ $$var -= lr \* accum$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* momentum: Momentum. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyMomentum](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1aad6f0afa69fbbc1896aceb60f9651bc8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum)` |
| `[SparseApplyMomentum](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a769bc8a904000fccba7f122e985687c9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, const [SparseApplyMomentum::Attrs](../../../struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a30b8c7c6bf9f92ee2be7ac7297df6fa2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a64f0643f05faf59221caf6fce9bbe4b5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a79f23cdeb4f72f3271572314b76661a4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a1be0ad2b688da68c70f65c7ae802a258)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a8eb81a827b3a21e7a6feaef16e6df395)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a91893d64df26bd060d9da800107c6e3c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_sparse_apply_momentum_1a90b8463d951fbf572ba63b9ec8ca3946)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyMomentum::Attrs](../../../struct/tensorflow/ops/sparse-apply-momentum/attrs) | Optional attribute setters for [SparseApplyMomentum](sparse-apply-momentum#classtensorflow_1_1ops_1_1_sparse_apply_momentum). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyMomentum
```
SparseApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input momentum
)
```
### SparseApplyMomentum
```
SparseApplyMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input momentum,
const SparseApplyMomentum::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
tensorflow_cpp tensorflow::ops::DepthwiseConv2dNative tensorflow::ops::DepthwiseConv2dNative
======================================
`#include <nn_ops.h>`
Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors.
Summary
-------
Given an input tensor of shape `[batch, in_height, in_width, in_channels]` and a filter / kernel tensor of shape `[filter_height, filter_width, in_channels, channel_multiplier]`, containing `in_channels` convolutional filters of depth 1, `depthwise_conv2d` applies a different filter to each input channel (expanding from 1 channel to `channel_multiplier` channels for each), then concatenates the results together. Thus, the output has `in_channels * channel_multiplier` channels.
```
for k in 0..in_channels-1
for q in 0..channel_multiplier-1
output[b, i, j, k * channel_multiplier + q] =
sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
filter[di, dj, k, q]
```
Must have `strides[0] = strides[3] = 1`. For the most common case of the same horizontal and vertices strides, `strides = [1, stride, stride, 1]`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* strides: 1-D of length 4. The stride of the sliding window for each dimension of `input`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width].
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[DepthwiseConv2dNative](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a50c225536301350d0a2a4e15f11bb1e8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[DepthwiseConv2dNative](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a1403cd12618eaad516b1e553b99a2dec)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const [DepthwiseConv2dNative::Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1af4279f97302c2185f1577d3cee105837)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a787a2254c323c4cc73067daa11e2b646)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1ab6d86ff41ea2b1ec8b84bd58bda5b4c7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1ab08d7fc817e77e96f3d713f9c4536ccd)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1aaa32a9f3e246eae5adc3000f23eb8e88)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a51fe0b98bda9604c4dcb4ce5156714df)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a36765465f25da5bb2ff97249302c8806)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_1a73ae4e50791a90681f92a54719605f21)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native/attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DepthwiseConv2dNative::Attrs](../../../struct/tensorflow/ops/depthwise-conv2d-native/attrs) | Optional attribute setters for [DepthwiseConv2dNative](depthwise-conv2d-native#classtensorflow_1_1ops_1_1_depthwise_conv2d_native). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DepthwiseConv2dNative
```
DepthwiseConv2dNative(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### DepthwiseConv2dNative
```
DepthwiseConv2dNative(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const DepthwiseConv2dNative::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV3 tensorflow::ops::QuantizeAndDequantizeV3
========================================
`#include <array_ops.h>`
Quantizes then dequantizes a tensor.
Summary
-------
This is almost identical to [QuantizeAndDequantizeV2](quantize-and-dequantize-v2#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2), except that num\_bits is a tensor, so its value can change during training.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[QuantizeAndDequantizeV3](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a2b0da7dac824893b88830e315543a00d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_bits)` |
| `[QuantizeAndDequantizeV3](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a5ec28b67b64ef7a45785390e91042d6d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_bits, const [QuantizeAndDequantizeV3::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v3/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a8aa70ba4802094bc7d64cf7c38915301)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a237fd659faaa4a2508a141f02bd2fda1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a2fe42b89b1a1a5d4a9e2e772624f3859)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a315fb3b3e2ca6a75ed7d8e22d90b4086)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a7bcde8fb5d1f0e0285a036916e243aab)() const` | |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1a83628e2124fba6f4c409c65419bb09c7)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v3/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1aba70d8cb905c10f26973de277469bdea)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v3/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` |
| `[RangeGiven](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1ab62c72984150a3a4ed4feffb9fa6ec95)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v3/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` |
| `[SignedInput](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1af8150be09574c209bb7af62829d2518c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v3/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizeAndDequantizeV3::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v3/attrs) | Optional attribute setters for [QuantizeAndDequantizeV3](quantize-and-dequantize-v3#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizeAndDequantizeV3
```
QuantizeAndDequantizeV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max,
::tensorflow::Input num_bits
)
```
### QuantizeAndDequantizeV3
```
QuantizeAndDequantizeV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max,
::tensorflow::Input num_bits,
const QuantizeAndDequantizeV3::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### RangeGiven
```
Attrs RangeGiven(
bool x
)
```
### SignedInput
```
Attrs SignedInput(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceScatterNdAdd tensorflow::ops::ResourceScatterNdAdd
=====================================
`#include <state_ops.h>`
Applies sparse addition to individual values or slices in a [Variable](variable#classtensorflow_1_1ops_1_1_variable).
Summary
-------
`ref` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with rank `P` and `indices` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of `indices` (with length `K`) corresponds to indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th dimension of `ref`.
`updates` is `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q-1+P-K` with shape:
```
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
```
For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 elements. In Python, that addition would look like this:
```
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
add = tf.scatter_nd_add(ref, indices, updates)
with tf.Session() as sess:
print sess.run(add)
```
The resulting update to ref would look like this:
```
[1, 13, 3, 14, 14, 6, 7, 20]
```
See `tf.scatter_nd` for more details about how to make updates to slices.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A resource handle. Must be from a VarHandleOp.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of values to add to ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-add/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_add_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceScatterNdAdd](#classtensorflow_1_1ops_1_1_resource_scatter_nd_add_1ac61a21576bf08251b3104cbc6368deaf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ResourceScatterNdAdd](#classtensorflow_1_1ops_1_1_resource_scatter_nd_add_1ac36189a70aec0cf684abb8369d023498)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ResourceScatterNdAdd::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-add/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_add_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_add_1ac94d129f0515c41be9253e727aaa988f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_scatter_nd_add_1a92cc69e6d97d0804f540a89ecc837f72)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_scatter_nd_add_1a817236acee28e1372228a96333567b07)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-add/attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_add_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceScatterNdAdd::Attrs](../../../struct/tensorflow/ops/resource-scatter-nd-add/attrs) | Optional attribute setters for [ResourceScatterNdAdd](resource-scatter-nd-add#classtensorflow_1_1ops_1_1_resource_scatter_nd_add). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceScatterNdAdd
```
ResourceScatterNdAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ResourceScatterNdAdd
```
ResourceScatterNdAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ResourceScatterNdAdd::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ScalarSummary tensorflow::ops::ScalarSummary
==============================
`#include <logging_ops.h>`
Outputs a `Summary` protocol buffer with scalar values.
Summary
-------
The input `tags` and `values` must have the same shape. The generated summary has a summary value for each tag-value pair in `tags` and `values`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* tags: Tags for the summary.
* values: Same shape as `tags. Values for the summary.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Scalar. Serialized `Summary` protocol buffer.
| Constructors and Destructors |
| --- |
| `[ScalarSummary](#classtensorflow_1_1ops_1_1_scalar_summary_1a37ead9a3e40afb5ca6c768bd9964fc60)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tags, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scalar_summary_1a0846561767f6abb3de936cc26f92eb42)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[summary](#classtensorflow_1_1ops_1_1_scalar_summary_1a8d164e18d2a22962eacd48e8f77ab864)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scalar_summary_1a8541b3eb0514c816421a7f1ac6343083)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scalar_summary_1aedb9308de46ad38d9bb8d680ad4e9419)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scalar_summary_1a4a426ca21e1f1e4df05580aba8f22238)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### summary
```
::tensorflow::Output summary
```
Public functions
----------------
### ScalarSummary
```
ScalarSummary(
const ::tensorflow::Scope & scope,
::tensorflow::Input tags,
::tensorflow::Input values
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Real tensorflow::ops::Real
=====================
`#include <math_ops.h>`
Returns the real part of a complex number.
Summary
-------
Given a tensor `input` of complex numbers, this operation returns a tensor of type `float` that is the real part of each element in `input`. [All](all#classtensorflow_1_1ops_1_1_all) elements in `input` must be complex numbers of the form \(a + bj\), where *a* is the real part returned by this operation and *b* is the imaginary part.
For example:
```
# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
tf.real(input) ==> [-2.25, 3.25]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Real](#classtensorflow_1_1ops_1_1_real_1a325ef3b733f6ad8692d9720b7e54225d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[Real](#classtensorflow_1_1ops_1_1_real_1af45fe6c2bfe92acdfcd8e336edae84fa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [Real::Attrs](../../../struct/tensorflow/ops/real/attrs#structtensorflow_1_1ops_1_1_real_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_real_1aa95f3627ba746f832e286cdac76fb519)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_real_1a9cea0b88989b3dbfc93309a32579998f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_real_1a867b9ea135418a9d1464fdfe16980b7f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_real_1acd53e8c51378fa3ea7d4bdba4a188c3f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_real_1a58cc5679f42ee343e17d4ac4cea1aae7)() const` | |
| Public static functions |
| --- |
| `[Tout](#classtensorflow_1_1ops_1_1_real_1a3978d1a4514b02a46543aaa1dc8ce5ef)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/real/attrs#structtensorflow_1_1ops_1_1_real_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Real::Attrs](../../../struct/tensorflow/ops/real/attrs) | Optional attribute setters for [Real](real#classtensorflow_1_1ops_1_1_real). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Real
```
Real(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### Real
```
Real(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const Real::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Tout
```
Attrs Tout(
DataType x
)
```
tensorflow_cpp tensorflow::ops::Negate tensorflow::ops::Negate
=======================
`#include <math_ops.h>`
Computes numerical negative value element-wise.
Summary
-------
I.e., \(y = -x\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
Aliases:
* Neg
| Constructors and Destructors |
| --- |
| `[Negate](#classtensorflow_1_1ops_1_1_negate_1aa141d393fff5adab1851946c7947df23)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_negate_1a31c9a16732e9b257968d2b940f68cdd5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_negate_1ac20834be0a01797fcebe0e6e5c5d0d98)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_negate_1ab94f1c6080f2e62217b2a3bb3b26a732)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_negate_1a1123b556426cb437cb1e498d50ddbcb8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_negate_1a7f2420d736e6c7ed48eb4b3a7fa915a7)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Negate
```
Negate(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::PlaceholderWithDefault tensorflow::ops::PlaceholderWithDefault
=======================================
`#include <array_ops.h>`
A placeholder op that passes through `input` when its output is not fed.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The default value to produce when `output` is not fed.
* shape: The (possibly partial) shape of the tensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A placeholder tensor that defaults to `input` if it is not fed.
| Constructors and Destructors |
| --- |
| `[PlaceholderWithDefault](#classtensorflow_1_1ops_1_1_placeholder_with_default_1ae4d4b5f83270ca5703ffe69f02a15eb7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, PartialTensorShape shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_placeholder_with_default_1aad20a686bc26b793fb68b299dcf7b9fd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_placeholder_with_default_1a88a9e63e6171a4176dfb91f2fc3c05fd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_placeholder_with_default_1a1a5464a28eaeb73dac97051e6864fbb2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_placeholder_with_default_1ad83a6453e256fd62263007bbeadc45a3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_placeholder_with_default_1a8212ef889952d76a1a68cc14c6ff2107)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### PlaceholderWithDefault
```
PlaceholderWithDefault(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
PartialTensorShape shape
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AccumulatorNumAccumulated tensorflow::ops::AccumulatorNumAccumulated
==========================================
`#include <data_flow_ops.h>`
Returns the number of gradients aggregated in the given accumulators.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to an accumulator.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The number of gradients aggregated in the given accumulator.
| Constructors and Destructors |
| --- |
| `[AccumulatorNumAccumulated](#classtensorflow_1_1ops_1_1_accumulator_num_accumulated_1a3144e5fc1afca44d338fa403c8badb0a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| Public attributes |
| --- |
| `[num\_accumulated](#classtensorflow_1_1ops_1_1_accumulator_num_accumulated_1a7ad2ad0f12c33ce150bb929c702a6346)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_accumulator_num_accumulated_1a9cf46e80cb7887111c2eda3b2eb11724)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_accumulator_num_accumulated_1ae5d7753ee2b6d185f9faf46fece3c84c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_accumulator_num_accumulated_1a1ccaa8d461c8159aad401b089860c325)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_accumulator_num_accumulated_1ad2c25412af7091278e323d4d1116f291)() const` | |
Public attributes
-----------------
### num\_accumulated
```
::tensorflow::Output num_accumulated
```
### operation
```
Operation operation
```
Public functions
----------------
### AccumulatorNumAccumulated
```
AccumulatorNumAccumulated(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::NextIteration tensorflow::ops::NextIteration
==============================
`#include <control_flow_ops.h>`
Makes its input available to the next iteration.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* data: The tensor to be made available to the next iteration.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The same tensor as `data`.
| Constructors and Destructors |
| --- |
| `[NextIteration](#classtensorflow_1_1ops_1_1_next_iteration_1a271c7d00029450a51cc760d1df561811)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_next_iteration_1ab3f003d6632d903e00d9df9ff972fa89)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_next_iteration_1a5ece906e43d4435359cdb423a19bcf50)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_next_iteration_1ac6c8e12efcce4901125c54e73a62a5ac)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_next_iteration_1aa75a2e7d184712a9339557082dc4de99)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_next_iteration_1a908343e5af317f3253f55d016a94aef6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### NextIteration
```
NextIteration(
const ::tensorflow::Scope & scope,
::tensorflow::Input data
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::LogUniformCandidateSampler tensorflow::ops::LogUniformCandidateSampler
===========================================
`#include <candidate_sampling_ops.h>`
Generates labels for candidate sampling with a log-uniform distribution.
Summary
-------
See explanations of candidate sampling and the data formats at go/candidate-sampling.
For each batch, this op picks a single set of sampled candidate labels.
The advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* true\_classes: A batch\_size \* num\_true matrix, in which each row contains the IDs of the num\_true target\_classes in the corresponding original label.
* num\_true: Number of true labels per context.
* num\_sampled: Number of candidates to randomly sample.
* unique: If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.
* range\_max: The sampler will sample integers from the interval [0, range\_max).
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs)`):
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sampled\_candidates: A vector of length num\_sampled, in which each element is the ID of a sampled candidate.
* `[Output](../output#classtensorflow_1_1_output)` true\_expected\_count: A batch\_size \* num\_true matrix, representing the number of times each candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
* `[Output](../output#classtensorflow_1_1_output)` sampled\_expected\_count: A vector of length num\_sampled, for each sampled candidate representing the number of times the candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
| Constructors and Destructors |
| --- |
| `[LogUniformCandidateSampler](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a53decbe73badf37e773a6e751809f64e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)` |
| `[LogUniformCandidateSampler](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a5c61a7307f78f73a2e8dce57c971daa2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const [LogUniformCandidateSampler::Attrs](../../../struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1aa51b20a7e281994aa03e15cf000e8187)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sampled\_candidates](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a274f630ba32adfbc046a9b365ee0a2c2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sampled\_expected\_count](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1acb096bb548c1449d866d0707cc1fc8fd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[true\_expected\_count](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a026cc7983c694439724e84f86e776572)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1adff11ef65461633e2c9d8a1232a6f1a3)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a55dcb7900bb164943bf67092b172fbb6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::LogUniformCandidateSampler::Attrs](../../../struct/tensorflow/ops/log-uniform-candidate-sampler/attrs) | Optional attribute setters for [LogUniformCandidateSampler](log-uniform-candidate-sampler#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sampled\_candidates
```
::tensorflow::Output sampled_candidates
```
### sampled\_expected\_count
```
::tensorflow::Output sampled_expected_count
```
### true\_expected\_count
```
::tensorflow::Output true_expected_count
```
Public functions
----------------
### LogUniformCandidateSampler
```
LogUniformCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max
)
```
### LogUniformCandidateSampler
```
LogUniformCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max,
const LogUniformCandidateSampler::Attrs & attrs
)
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::Dequantize tensorflow::ops::Dequantize
===========================
`#include <array_ops.h>`
[Dequantize](dequantize#classtensorflow_1_1ops_1_1_dequantize) the 'input' tensor into a float or bfloat16 [Tensor](../tensor#classtensorflow_1_1_tensor).
Summary
-------
[min\_range, max\_range] are scalar floats that specify the range for the output. The 'mode' attribute controls exactly which calculations are used to convert the float values to their quantized equivalents.
In 'MIN\_COMBINED' mode, each value of the tensor will undergo the following:
```
if T == qint8: in[i] += (range(T) + 1)/ 2.0
out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
```
here `range(T) = numeric_limits::max() - numeric\_limits::min()`
*MIN\_COMBINED Mode Example*
If the input comes from a [QuantizedRelu6](quantized-relu6#classtensorflow_1_1ops_1_1_quantized_relu6), the output type is quint8 (range of 0-255) but the possible range of [QuantizedRelu6](quantized-relu6#classtensorflow_1_1ops_1_1_quantized_relu6) is 0-6. The min\_range and max\_range values are therefore 0.0 and 6.0. [Dequantize](dequantize#classtensorflow_1_1ops_1_1_dequantize) on quint8 will take each value, cast to float, and multiply by 6 / 255. Note that if quantizedtype is qint8, the operation will additionally add each value by 128 prior to casting.
If the mode is 'MIN\_FIRST', then this approach is used:
```
num_discrete_values = 1 << (# of bits in T)
range_adjust = num_discrete_values / (num_discrete_values - 1)
range = (range_max - range_min) * range_adjust
range_scale = range / num_discrete_values
const double offset_input = static_cast(input) - lowest_quantized;
result = range_min + ((input - numeric_limits::min()) * range_scale)
```
If the mode is `SCALED`, dequantization is performed by multiplying each input value by a scaling\_factor. (Thus an input of 0 always maps to 0.0).
The scaling\_factor is determined from `min_range`, `max_range`, and `narrow_range` in a way that is compatible with `QuantizeAndDequantize{V2|V3}` and `[QuantizeV2](quantize-v2#classtensorflow_1_1ops_1_1_quantize_v2)`, using the following algorithm:
```
const int min_expected_T = std::numeric_limits::min() +
(narrow_range ? 1 : 0);
const int max_expected_T = std::numeric_limits::max();
const float max_expected_T = std::numeric_limits::max();
```
```
const float scale_factor =
(std::numeric_limits::min() == 0) ? (max_range / max_expected_T)
: std::max(min_range / min_expected_T,
max_range / max_expected_T);
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_range: The minimum scalar value possibly produced for the input.
* max\_range: The maximum scalar value possibly produced for the input.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/dequantize/attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)`):
* dtype: Type of the output tensor. Currently [Dequantize](dequantize#classtensorflow_1_1ops_1_1_dequantize) supports float and bfloat16. If 'dtype' is 'bfloat16', it only supports 'MIN\_COMBINED' mode.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Dequantize](#classtensorflow_1_1ops_1_1_dequantize_1ace6411557abc00c6e59649720be7d579)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_range, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_range)` |
| `[Dequantize](#classtensorflow_1_1ops_1_1_dequantize_1afb71f46f9e4fc4922578ecd9116ad9b1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_range, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_range, const [Dequantize::Attrs](../../../struct/tensorflow/ops/dequantize/attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_dequantize_1a917ce29fbec6ef49406db9a374bde9aa)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_dequantize_1a5c4618ae3d058bcd8547217612f8f41e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_dequantize_1a4bdeb613e4b88880638a67528cbd01f0)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_dequantize_1ab1b62ee39a382d6e124eb62156c05525)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_dequantize_1ae01ee2df9b62f7729848ca15ed70e8fc)() const` | |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_dequantize_1ac0b7d9ea267e2c8719f63ff4434b5250)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/dequantize/attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` |
| `[Dtype](#classtensorflow_1_1ops_1_1_dequantize_1aeb2c0e323cdc6f85554c6e03de751730)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/dequantize/attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` |
| `[Mode](#classtensorflow_1_1ops_1_1_dequantize_1ac9873b34c5c0eb36296e0fe726644fc9)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/dequantize/attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_dequantize_1a4409107547aae6b42715813687850b35)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/dequantize/attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Dequantize::Attrs](../../../struct/tensorflow/ops/dequantize/attrs) | Optional attribute setters for [Dequantize](dequantize#classtensorflow_1_1ops_1_1_dequantize). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Dequantize
```
Dequantize(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input min_range,
::tensorflow::Input max_range
)
```
### Dequantize
```
Dequantize(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input min_range,
::tensorflow::Input max_range,
const Dequantize::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
### Dtype
```
Attrs Dtype(
DataType x
)
```
### Mode
```
Attrs Mode(
StringPiece x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseFillEmptyRows tensorflow::ops::SparseFillEmptyRows
====================================
`#include <sparse_ops.h>`
Fills empty rows in the input 2-D `SparseTensor` with a default value.
Summary
-------
The input `SparseTensor` is represented via the tuple of inputs (`indices`, `values`, `dense_shape`). The output `SparseTensor` has the same `dense_shape` but with indices `output_indices` and values `output_values`.
This op inserts a single entry for every row that doesn't have any values. The index is created as `[row, 0, ..., 0]` and the inserted value is `default_value`.
For example, suppose `sp_input` has shape `[5, 6]` and non-empty values:
```
[0, 1]: a
[0, 3]: b
[2, 0]: c
[3, 1]: d
```
Rows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values:
```
[0, 1]: a
[0, 3]: b
[1, 0]: default_value
[2, 0]: c
[3, 1]: d
[4, 0]: default_value
```
The output `SparseTensor` will be in row-major order and will have the same shape as the input.
This op also returns an indicator vector shaped `[dense_shape[0]]` such that
```
empty_row_indicator[i] = True iff row i was an empty row.
```
And a reverse index map vector shaped `[indices.shape[0]]` that is used during backpropagation,
```
reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: 2-D. the indices of the sparse tensor.
* values: 1-D. the values of the sparse tensor.
* dense\_shape: 1-D. the shape of the sparse tensor.
* default\_value: 0-D. default value to insert into location `[row, 0, ..., 0]` for rows missing from the input sparse tensor. output indices: 2-D. the indices of the filled sparse tensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices
* `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. the values of the filled sparse tensor.
* `[Output](../output#classtensorflow_1_1_output)` empty\_row\_indicator: 1-D. whether the dense row was missing in the input sparse tensor.
* `[Output](../output#classtensorflow_1_1_output)` reverse\_index\_map: 1-D. a map from the input indices to the output indices.
| Constructors and Destructors |
| --- |
| `[SparseFillEmptyRows](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a879e72f00ec2907ae24319568619e724)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) default_value)` |
| Public attributes |
| --- |
| `[empty\_row\_indicator](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1adb1b94f12679619031e52393d4dde736)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a904fc23a9366dfb3edb6e9ce97f51176)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a2e77eb808d738a81625bc66d14e269c2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1a050f6a03931adf4b1fe9fe0933537d4f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reverse\_index\_map](#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows_1af0519edc8137614dd36f96f10ed6e4ef)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### empty\_row\_indicator
```
::tensorflow::Output empty_row_indicator
```
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_values
```
::tensorflow::Output output_values
```
### reverse\_index\_map
```
::tensorflow::Output reverse_index_map
```
Public functions
----------------
### SparseFillEmptyRows
```
SparseFillEmptyRows(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
::tensorflow::Input values,
::tensorflow::Input dense_shape,
::tensorflow::Input default_value
)
```
tensorflow_cpp tensorflow::ops::DecodeJpeg tensorflow::ops::DecodeJpeg
===========================
`#include <image_ops.h>`
Decode a JPEG-encoded image to a uint8 tensor.
Summary
-------
The attr `channels` indicates the desired number of color channels for the decoded image.
Accepted values are:
* 0: Use the number of channels in the JPEG-encoded image.
* 1: output a grayscale image.
* 3: output an RGB image.
If needed, the JPEG-encoded image is transformed to match the requested number of color channels.
The attr `ratio` allows downscaling the image by an integer factor during decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than downscaling the image later.
This op also supports decoding PNGs and non-animated GIFs since the interface is the same, though it is cleaner to use `tf.io.decode_image`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* contents: 0-D. The JPEG-encoded image.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)`):
* channels: Number of color channels for the decoded image.
* ratio: Downscaling ratio.
* fancy\_upscaling: If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only).
* try\_recover\_truncated: If true try to recover an image from truncated input.
* acceptable\_fraction: The minimum required fraction of lines before a truncated input is accepted.
* dct\_method: string specifying a hint about the algorithm used for decompression. Defaults to "" which maps to a system-specific default. Currently valid values are ["INTEGER\_FAST", "INTEGER\_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg library changes to a version that does not have that specific option.)
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D with shape `[height, width, channels]`..
| Constructors and Destructors |
| --- |
| `[DecodeJpeg](#classtensorflow_1_1ops_1_1_decode_jpeg_1ac4de6e02218f7ad73fca207fdedcbcad)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| `[DecodeJpeg](#classtensorflow_1_1ops_1_1_decode_jpeg_1a3d8ca9fbb0c56f07d1dfc15707345456)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, const [DecodeJpeg::Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[image](#classtensorflow_1_1ops_1_1_decode_jpeg_1ae6c2f8ba16e122ec6fffd95b36d65ead)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_decode_jpeg_1ac493d7d06da539cac7983b2046f8e9d1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_jpeg_1a62de1d307840ceb881b006cd346264f1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_jpeg_1a87002e2b5765be434ab912f4ae691605)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_jpeg_1af3a81e6979e68a832cbbc27890b24704)() const` | |
| Public static functions |
| --- |
| `[AcceptableFraction](#classtensorflow_1_1ops_1_1_decode_jpeg_1a3e5bf8acaa171c786f414da0c3717e15)(float x)` | `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` |
| `[Channels](#classtensorflow_1_1ops_1_1_decode_jpeg_1a4ced6488b8eb52569e4c64cb514ae5af)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` |
| `[DctMethod](#classtensorflow_1_1ops_1_1_decode_jpeg_1a11a129bf8cb32c9b4b80b8f379be1356)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` |
| `[FancyUpscaling](#classtensorflow_1_1ops_1_1_decode_jpeg_1a32505c9ff48d85625d2d574385e580d7)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` |
| `[Ratio](#classtensorflow_1_1ops_1_1_decode_jpeg_1a55a5fb907878bbe1ed6fc08e696f55ce)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` |
| `[TryRecoverTruncated](#classtensorflow_1_1ops_1_1_decode_jpeg_1a0d8254ea2a648d8ad63b90b2e39d9cf5)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodeJpeg::Attrs](../../../struct/tensorflow/ops/decode-jpeg/attrs) | Optional attribute setters for [DecodeJpeg](decode-jpeg#classtensorflow_1_1ops_1_1_decode_jpeg). |
Public attributes
-----------------
### image
```
::tensorflow::Output image
```
### operation
```
Operation operation
```
Public functions
----------------
### DecodeJpeg
```
DecodeJpeg(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents
)
```
### DecodeJpeg
```
DecodeJpeg(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents,
const DecodeJpeg::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AcceptableFraction
```
Attrs AcceptableFraction(
float x
)
```
### Channels
```
Attrs Channels(
int64 x
)
```
### DctMethod
```
Attrs DctMethod(
StringPiece x
)
```
### FancyUpscaling
```
Attrs FancyUpscaling(
bool x
)
```
### Ratio
```
Attrs Ratio(
int64 x
)
```
### TryRecoverTruncated
```
Attrs TryRecoverTruncated(
bool x
)
```
tensorflow_cpp tensorflow::ops::ComputeAccidentalHits tensorflow::ops::ComputeAccidentalHits
======================================
`#include <candidate_sampling_ops.h>`
Computes the ids of the positions in sampled\_candidates that match true\_labels.
Summary
-------
When doing log-odds NCE, the result of this op should be passed through a SparseToDense op, then added to the logits of the sampled candidates. This has the effect of 'removing' the sampled labels that match the true labels by making the classifier sure that they are sampled labels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* true\_classes: The true\_classes output of UnpackSparseLabels.
* sampled\_candidates: The sampled\_candidates output of CandidateSampler.
* num\_true: Number of true labels per context.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/compute-accidental-hits/attrs#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs)`):
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` indices: A vector of indices corresponding to rows of true\_candidates.
* `[Output](../output#classtensorflow_1_1_output)` ids: A vector of IDs of positions in sampled\_candidates that match a true\_label for the row with the corresponding index in indices.
* `[Output](../output#classtensorflow_1_1_output)` weights: A vector of the same length as indices and ids, in which each element is -FLOAT\_MAX.
| Constructors and Destructors |
| --- |
| `[ComputeAccidentalHits](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1a4bad395ebe64ce16a3a939af5780fba8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sampled_candidates, int64 num_true)` |
| `[ComputeAccidentalHits](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1aab1a8827d014d52e454b58bff11c2bd0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sampled_candidates, int64 num_true, const [ComputeAccidentalHits::Attrs](../../../struct/tensorflow/ops/compute-accidental-hits/attrs#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[ids](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1a1358bfad5b628af8856e417933559349)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[indices](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1a30b8d0fdb8dea05a48830d9855d59c2f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1a3584a7d9cccec061e9e9e0127ca00682)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[weights](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1ab5df3c291c46b6daab30792e03782778)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1a21e671a41beda2c875664e18da16dee9)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/compute-accidental-hits/attrs#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_compute_accidental_hits_1a382ee99a2ad217bea85674c232a253f0)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/compute-accidental-hits/attrs#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ComputeAccidentalHits::Attrs](../../../struct/tensorflow/ops/compute-accidental-hits/attrs) | Optional attribute setters for [ComputeAccidentalHits](compute-accidental-hits#classtensorflow_1_1ops_1_1_compute_accidental_hits). |
Public attributes
-----------------
### ids
```
::tensorflow::Output ids
```
### indices
```
::tensorflow::Output indices
```
### operation
```
Operation operation
```
### weights
```
::tensorflow::Output weights
```
Public functions
----------------
### ComputeAccidentalHits
```
ComputeAccidentalHits(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
::tensorflow::Input sampled_candidates,
int64 num_true
)
```
### ComputeAccidentalHits
```
ComputeAccidentalHits(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
::tensorflow::Input sampled_candidates,
int64 num_true,
const ComputeAccidentalHits::Attrs & attrs
)
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::SparseReduceSumSparse tensorflow::ops::SparseReduceSumSparse
======================================
`#include <sparse_ops.h>`
Computes the sum of elements across dimensions of a SparseTensor.
Summary
-------
This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_sum()`. In contrast to [SparseReduceSum](sparse-reduce-sum#classtensorflow_1_1ops_1_1_sparse_reduce_sum), this Op returns a SparseTensor.
Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
If `reduction_axes` has no entries, all dimensions are reduced, and a tensor with a single element is returned. Additionally, the axes can be negative, which are interpreted according to the indexing rules in Python.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* input\_values: 1-D. `N` non-empty values corresponding to `input_indices`.
* input\_shape: 1-D. Shape of the input SparseTensor.
* reduction\_axes: 1-D. Length-`K` vector containing the reduction axes.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum-sparse/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices
* `[Output](../output#classtensorflow_1_1_output)` output\_values
* `[Output](../output#classtensorflow_1_1_output)` output\_shape
| Constructors and Destructors |
| --- |
| `[SparseReduceSumSparse](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1a6f708aa542de1f8a78354e33cd93ba1f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes)` |
| `[SparseReduceSumSparse](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1a3993e307a94ec2d2689f821a60717e99)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes, const [SparseReduceSumSparse::Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum-sparse/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1a163cffc8414946a47057a91af8be0e12)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1a2c546e86ac344ff2cc261c06aac187f4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1ad3c4282b03471d1e02bba7e17a46fca6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1a19b2438eeddfcd3e79017ecb5de54318)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1a8dbe087349a7dd3db345a7abd6752c3d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum-sparse/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseReduceSumSparse::Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum-sparse/attrs) | Optional attribute setters for [SparseReduceSumSparse](sparse-reduce-sum-sparse#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseReduceSumSparse
```
SparseReduceSumSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes
)
```
### SparseReduceSumSparse
```
SparseReduceSumSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes,
const SparseReduceSumSparse::Attrs & attrs
)
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::UnsortedSegmentMin tensorflow::ops::UnsortedSegmentMin
===================================
`#include <math_ops.h>`
Computes the minimum along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
This operator is similar to `tf.math.unsorted_segment_sum`, Instead of computing the sum over segments, it computes the minimum such that:
\(output\_i = \min\_{j...} data\_[j...]\) where min is over tuples `j...` such that `segment_ids[j...] == i`.
If the minimum is empty for a given segment ID `i`, it outputs the largest possible value for the specific numeric type, `output[i] = numeric_limits::max()`.
For example:
c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) tf.math.unsorted\_segment\_min(c, tf.constant([0, 1, 0]), num\_segments=2).numpy() array([[1, 2, 2, 1], [5, 6, 7, 8]], dtype=int32)
If the given segment ID `i` is negative, then the corresponding value is dropped, and will not be included in the result.
Caution: On CPU, values in `segment_ids` are always validated to be less than `num_segments`, and an error is thrown for out-of-bound indices. On GPU, this does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices result in safe but unspecified behavior, which may include ignoring out-of-bound indices or outputting a tensor with a 0 stored in the first dimension of its shape if `num_segments` is 0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A tensor whose shape is a prefix of `data.shape`. The values must be less than `num_segments`.
Caution: The values are always validated to be in range on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for the first `segment_ids.rank` dimensions, which are replaced with a single dimension which has size `num_segments`.
| Constructors and Destructors |
| --- |
| `[UnsortedSegmentMin](#classtensorflow_1_1ops_1_1_unsorted_segment_min_1ae09110a9077ca38485a301f9ae09b945)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_unsorted_segment_min_1ab42b66ddb9fc903f0cfcddfe78b69c08)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_unsorted_segment_min_1a796647a1e666d85ae64c1250449fafc0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_unsorted_segment_min_1ad0692a88c3ca15e43bfa4c812b16c984)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unsorted_segment_min_1a46d76058fd1e0e8a4990ecce6b5ab032)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unsorted_segment_min_1a2e739c76ea6491258b10031e06bd5a11)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### UnsortedSegmentMin
```
UnsortedSegmentMin(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MapSize tensorflow::ops::MapSize
========================
`#include <data_flow_ops.h>`
Op returns the number of elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The size tensor.
| Constructors and Destructors |
| --- |
| `[MapSize](#classtensorflow_1_1ops_1_1_map_size_1a88c2287aaee2e54989feddca67500907)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[MapSize](#classtensorflow_1_1ops_1_1_map_size_1a7d40c8041f9cadd36547b38cdb7313ca)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [MapSize::Attrs](../../../struct/tensorflow/ops/map-size/attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_map_size_1ae1efc931bc3844c66ecdf5aa8d87ab3b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_map_size_1afc34434fd421088c3eb7b8754b304c5f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_map_size_1ae0c7743d3c1cbe50d90a4239a6ce5077)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_map_size_1aa41a8023725a6e3d947547c942d10c1e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_map_size_1afd6f90785b9762747d138cc89ebd0f35)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_size_1a804c4c9e337506ac76e8fdad08a65570)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-size/attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_size_1a51283875596704ed9da7e5dde786af03)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-size/attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_size_1abbd8538c054507746a46afea57d51339)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-size/attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_size_1ae32734e03b927164ba648e7844c73f1c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-size/attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapSize::Attrs](../../../struct/tensorflow/ops/map-size/attrs) | Optional attribute setters for [MapSize](map-size#classtensorflow_1_1ops_1_1_map_size). |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### MapSize
```
MapSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### MapSize
```
MapSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const MapSize::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ScatterMax tensorflow::ops::ScatterMax
===========================
`#include <state_ops.h>`
Reduces sparse updates into a variable reference using the `max` operation.
Summary
-------
This operation computes
```
# Scalar indices
ref[indices, ...] = max(ref[indices, ...], updates[...])
# Vector indices (for each i)
ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
```
This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.
Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions combine.
Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* indices: A tensor of indices into the first dimension of `ref`.
* updates: A tensor of updated values to reduce into `ref`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-max/attrs#structtensorflow_1_1ops_1_1_scatter_max_1_1_attrs)`):
* use\_locking: If True, the update will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterMax](#classtensorflow_1_1ops_1_1_scatter_max_1a4b1981c9ecfc07eecf70ad30681d1dc9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterMax](#classtensorflow_1_1ops_1_1_scatter_max_1aea5c929e2ffcd0b4976bbedfc0903340)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterMax::Attrs](../../../struct/tensorflow/ops/scatter-max/attrs#structtensorflow_1_1ops_1_1_scatter_max_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_max_1a6cea238b2ed3345fd004087afbcacaa0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_max_1aca68eaae434ee66a9e3be45e8e0f8856)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_max_1ad80fd35ea7dbc046710b422267f92451)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_max_1a7a138a1072efbcfc196122618e9fa683)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_max_1a630424d5ee3a2fffc53b48acea14c38d)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_max_1aa62f389510e2320cf2bb0b64c40fa9db)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-max/attrs#structtensorflow_1_1ops_1_1_scatter_max_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterMax::Attrs](../../../struct/tensorflow/ops/scatter-max/attrs) | Optional attribute setters for [ScatterMax](scatter-max#classtensorflow_1_1ops_1_1_scatter_max). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterMax
```
ScatterMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterMax
```
ScatterMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterMax::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseReorder tensorflow::ops::SparseReorder
==============================
`#include <sparse_ops.h>`
Reorders a SparseTensor into the canonical, row-major ordering.
Summary
-------
Note that by convention, all sparse ops preserve the canonical ordering along increasing dimension number. The only time ordering can be violated is during manual manipulation of the indices and values vectors to add entries.
Reordering does not affect the shape of the SparseTensor.
If the tensor has rank `R` and `N` non-empty values, `input_indices` has shape `[N, R]`, input\_values has length `N`, and input\_shape has length `R`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* input\_values: 1-D. `N` non-empty values corresponding to `input_indices`.
* input\_shape: 1-D. Shape of the input SparseTensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. `N x R` matrix with the same indices as input\_indices, but in canonical row-major ordering.
* `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. `N` non-empty values corresponding to `output_indices`.
| Constructors and Destructors |
| --- |
| `[SparseReorder](#classtensorflow_1_1ops_1_1_sparse_reorder_1aafcce71e6de3ad9b8ce9618fe3b636a0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_reorder_1adbdca22d516880fc4093b79caf22bad3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_reorder_1af583efc1f49452eefa81d966158fd3b6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_reorder_1ad573d2b883ff9fa37df6b1ae4bc4ec18)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseReorder
```
SparseReorder(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape
)
```
tensorflow_cpp tensorflow::ops::InvertPermutation tensorflow::ops::InvertPermutation
==================================
`#include <array_ops.h>`
Computes the inverse permutation of a tensor.
Summary
-------
This operation computes the inverse of an index permutation. It takes a 1-D integer tensor `x`, which represents the indices of a zero-based array, and swaps each value with its index position. In other words, for an output tensor `y` and an input tensor `x`, this operation computes the following:
`y[x[i]] = i for i in [0, 1, ..., len(x) - 1]`
The values must include 0. There can be no duplicate values or negative values.
For example:
```
# tensor `x` is [3, 4, 0, 2, 1]
invert_permutation(x) ==> [2, 4, 3, 0, 1]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: 1-D.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D.
| Constructors and Destructors |
| --- |
| `[InvertPermutation](#classtensorflow_1_1ops_1_1_invert_permutation_1a47c39ba350709259ed5fbaec9e0e3ef8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_invert_permutation_1a10bdbd547af396286b226a61b4417c89)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_invert_permutation_1a4c610e367ae065a0aa870a4d171fd0d6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_invert_permutation_1af81a3c965d5a4111a80a32b928075993)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_invert_permutation_1a37078d47cc8bf77238aeb89a0768413b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_invert_permutation_1a7b457c171ec14a65cc07f10866ddcd76)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### InvertPermutation
```
InvertPermutation(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseCrossHashed tensorflow::ops::SparseCrossHashed
==================================
`#include <sparse_ops.h>`
Generates sparse cross from a list of sparse and dense tensors.
Summary
-------
The op takes two lists, one of 2D `SparseTensor` and one of 2D `[Tensor](../tensor#classtensorflow_1_1_tensor)`, each representing features of one feature column. It outputs a 2D `SparseTensor` with the batchwise crosses of these features.
For example, if the inputs are
```
inputs[0]: SparseTensor with shape = [2, 2]
[0, 0]: "a"
[1, 0]: "b"
[1, 1]: "c"
inputs[1]: SparseTensor with shape = [2, 1]
[0, 0]: "d"
[1, 0]: "e"
inputs[2]: Tensor [["f"], ["g"]]
```
then the output will be
```
shape = [2, 2]
[0, 0]: "a_X_d_X_f"
[1, 0]: "b_X_e_X_g"
[1, 1]: "c_X_e_X_g"
```
if hashed\_output=true then the output will be
```
shape = [2, 2]
[0, 0]: FingerprintCat64(
Fingerprint64("f"), FingerprintCat64(
Fingerprint64("d"), Fingerprint64("a")))
[1, 0]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("b")))
[1, 1]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("c")))
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: 2-D. Indices of each input `SparseTensor`.
* values: 1-D. values of each `SparseTensor`.
* shapes: 1-D. Shapes of each `SparseTensor`.
* dense\_inputs: 2-D. Columns represented by dense `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* num\_buckets: It is used if hashed\_output is true. output = hashed\_valuenum\_buckets if num\_buckets > 0 else hashed\_value.
* strong\_hash: boolean, if true, siphash with salt will be used instead of farmhash.
* salt: Specify the salt that will be used by the siphash function.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. Indices of the concatenated `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. Non-empty values of the concatenated or hashed `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` output\_shape: 1-D. Shape of the concatenated `SparseTensor`.
| Constructors and Destructors |
| --- |
| `[SparseCrossHashed](#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a75df417d574408f2c120294be39de389)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) shapes, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_buckets, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strong_hash, ::[tensorflow::Input](../input#classtensorflow_1_1_input) salt)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a68e99ac704684420839783001f5f37f4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a13ce1f14f64b18d1c495ccf725acf0bb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a89578d009bb75ad63a153f89045c46a2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_cross_hashed_1a6371e5ae28289305864042629e0b4fe5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseCrossHashed
```
SparseCrossHashed(
const ::tensorflow::Scope & scope,
::tensorflow::InputList indices,
::tensorflow::InputList values,
::tensorflow::InputList shapes,
::tensorflow::InputList dense_inputs,
::tensorflow::Input num_buckets,
::tensorflow::Input strong_hash,
::tensorflow::Input salt
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::WriteFile tensorflow::ops::WriteFile
==========================
`#include <io_ops.h>`
Writes `contents` to the file at input `filename`.
Summary
-------
Creates the file and recursively creates directory if it does not exist.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* filename: scalar. The name of the file to which we write the contents.
* contents: scalar. The content to be written to the output file.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[WriteFile](#classtensorflow_1_1ops_1_1_write_file_1a0b63c63af08131b1edef0b954e9b3f0d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filename, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_write_file_1ae280554653b226ad102867a40c276911)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_write_file_1af0ad99c4b33a1b5185455beb48fcdba5)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### WriteFile
```
WriteFile(
const ::tensorflow::Scope & scope,
::tensorflow::Input filename,
::tensorflow::Input contents
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::Rsqrt tensorflow::ops::Rsqrt
======================
`#include <math_ops.h>`
Computes reciprocal of square root of x element-wise.
Summary
-------
I.e., \(y = 1 / \sqrt{x}\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Rsqrt](#classtensorflow_1_1ops_1_1_rsqrt_1abc16de7fcf0ec12d02ae7f4e6893bf83)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_rsqrt_1a639a80c09085c52bab50885538476165)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_rsqrt_1a66b8f7c4a63fa61d1403b939b4a2eff9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_rsqrt_1a97b257dd5138c7b025428eb40c4071fe)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_rsqrt_1af272ffb20c352847affcf31d4121cf87)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_rsqrt_1ad4f30f6515cce1dffcaf68842f1620e2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Rsqrt
```
Rsqrt(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MaxPool3D tensorflow::ops::MaxPool3D
==========================
`#include <nn_ops.h>`
Performs 3D max pooling on the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Shape `[batch, depth, rows, cols, channels]` tensor to pool over.
* ksize: 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have `ksize[0] = ksize[4] = 1`.
* strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool3-d/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_1_1_attrs)`):
* data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The max pooled output tensor.
| Constructors and Destructors |
| --- |
| `[MaxPool3D](#classtensorflow_1_1ops_1_1_max_pool3_d_1aeb6586ec4fe23863dadcdf397955938c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPool3D](#classtensorflow_1_1ops_1_1_max_pool3_d_1a881d1a222223a16559edc5edc2dbb26a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPool3D::Attrs](../../../struct/tensorflow/ops/max-pool3-d/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool3_d_1a05a457fb3e2c711d36cbd33ee4cc870e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool3_d_1a205fc0930f581dc28a140df0227f881d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool3_d_1a65dc0444be728bff9614929b11ee04a7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool3_d_1a53f97b9d2f3e3cb1e294decc0c7db353)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool3_d_1ad647c73e65c2224bd258d40b817e3984)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool3_d_1adb9ab115eeca3aca6a708bdd6fc136a0)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool3-d/attrs#structtensorflow_1_1ops_1_1_max_pool3_d_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPool3D::Attrs](../../../struct/tensorflow/ops/max-pool3-d/attrs) | Optional attribute setters for [MaxPool3D](max-pool3-d#classtensorflow_1_1ops_1_1_max_pool3_d). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPool3D
```
MaxPool3D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPool3D
```
MaxPool3D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPool3D::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Fingerprint tensorflow::ops::Fingerprint
============================
`#include <array_ops.h>`
Generates fingerprint values.
Summary
-------
Generates fingerprint values of `data`.
[Fingerprint](fingerprint#classtensorflow_1_1ops_1_1_fingerprint) op considers the first dimension of `data` as the batch dimension, and `output[i]` contains the fingerprint value generated from contents in `data[i, ...]` for all `i`.
[Fingerprint](fingerprint#classtensorflow_1_1ops_1_1_fingerprint) op writes fingerprint values as byte arrays. For example, the default method `farmhash64` generates a 64-bit fingerprint value at a time. This 8-byte value is written out as an `uint8` array of size 8, in little-endian order.
For example, suppose that `data` has data type `DT_INT32` and shape (2, 3, 4), and that the fingerprint method is `farmhash64`. In this case, the output shape is (2, 8), where 2 is the batch dimension size of `data`, and 8 is the size of each fingerprint value in bytes. `output[0, :]` is generated from 12 integers in `data[0, :, :]` and similarly `output[1, :]` is generated from other 12 integers in `data[1, :, :]`.
Note that this op fingerprints the raw underlying buffer, and it does not fingerprint [Tensor](../tensor#classtensorflow_1_1_tensor)'s metadata such as data type and/or shape. For example, the fingerprint values are invariant under reshapes and bitcasts as long as the batch dimension remain the same:
```
Fingerprint(data) == Fingerprint(Reshape(data, ...))
Fingerprint(data) == Fingerprint(Bitcast(data, ...))
```
For string data, one should expect `Fingerprint(data) != Fingerprint(ReduceJoin(data))` in general.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* data: Must have rank 1 or higher.
* method: [Fingerprint](fingerprint#classtensorflow_1_1ops_1_1_fingerprint) method used by this op. Currently available method is `farmhash::fingerprint64`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A two-dimensional `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `tf.uint8`. The first dimension equals to `data`'s first dimension, and the second dimension size depends on the fingerprint algorithm.
| Constructors and Destructors |
| --- |
| `[Fingerprint](#classtensorflow_1_1ops_1_1_fingerprint_1a5a9ba3aaf3975b520b93b93f97d3218e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) method)` |
| Public attributes |
| --- |
| `[fingerprint](#classtensorflow_1_1ops_1_1_fingerprint_1acb15a2bc227362487ec02887bd37371b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fingerprint_1a28c7645b277237010a0c6e2b37c9e520)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fingerprint_1a6605930068854f0e7e5ba0ad2ce90daa)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fingerprint_1af0b4d90e2ccbff5efb796771a356e94d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fingerprint_1a1d72f0d143362ae62b95dfdadd166164)() const` | |
Public attributes
-----------------
### fingerprint
```
::tensorflow::Output fingerprint
```
### operation
```
Operation operation
```
Public functions
----------------
### Fingerprint
```
Fingerprint(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input method
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RestoreV2 tensorflow::ops::RestoreV2
==========================
`#include <io_ops.h>`
Restores tensors from a V2 checkpoint.
Summary
-------
For backward compatibility with the V1 format, this Op currently allows restoring from a V1 checkpoint as well:
* This Op first attempts to find the V2 index file pointed to by "prefix", and if found proceed to read it as a V2 checkpoint;
* Otherwise the V1 read path is invoked. Relying on this behavior is not recommended, as the ability to fall back to read V1 might be deprecated and eventually removed.
By default, restores the named tensors in full. If the caller wishes to restore specific slices of stored tensors, "shape\_and\_slices" should be non-empty strings and correspondingly well-formed.
Callers must ensure all the named tensors are indeed stored in the checkpoint.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* prefix: Must have a single element. The prefix of a V2 checkpoint.
* tensor\_names: shape {N}. The names of the tensors to be restored.
* shape\_and\_slices: shape {N}. The slice specs of the tensors to be restored. [Empty](empty#classtensorflow_1_1ops_1_1_empty) strings indicate that they are non-partitioned tensors.
* dtypes: shape {N}. The list of expected dtype for the tensors. Must match those stored in the checkpoint.
Returns:
* `OutputList`: shape {N}. The restored tensors, whose shapes are read from the checkpoint directly.
| Constructors and Destructors |
| --- |
| `[RestoreV2](#classtensorflow_1_1ops_1_1_restore_v2_1a57bca4a84e5b10e9920fdeeac3a05f5e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) prefix, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_names, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape_and_slices, const DataTypeSlice & dtypes)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_restore_v2_1ac15e029a658d659cfed51e641fd25034)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[tensors](#classtensorflow_1_1ops_1_1_restore_v2_1acec293134264696f9ac7e0f1d900d542)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_restore_v2_1a6bd9fcb0de236ef33532417834b3ed0d)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### tensors
```
::tensorflow::OutputList tensors
```
Public functions
----------------
### RestoreV2
```
RestoreV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input prefix,
::tensorflow::Input tensor_names,
::tensorflow::Input shape_and_slices,
const DataTypeSlice & dtypes
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
tensorflow_cpp tensorflow::ops::NotEqual tensorflow::ops::NotEqual
=========================
`#include <math_ops.h>`
Returns the truth value of (x != y) element-wise.
Summary
-------
*NOTE*: `[NotEqual](not-equal#classtensorflow_1_1ops_1_1_not_equal)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[NotEqual](#classtensorflow_1_1ops_1_1_not_equal_1a668e07d99a2d214c5b6c7869a7913277)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| `[NotEqual](#classtensorflow_1_1ops_1_1_not_equal_1a0eacbc9246bc259b9027b9e5de999555)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, const [NotEqual::Attrs](../../../struct/tensorflow/ops/not-equal/attrs#structtensorflow_1_1ops_1_1_not_equal_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_not_equal_1a9eed76013e03fbca722f39a91900b701)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_not_equal_1a2130c3f3c6a92ae9233d2f60e71abc87)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_not_equal_1acf9d98286cfefd465f4708077a8b3437)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_not_equal_1a4640dbb56bdb7eabbe81c4acee16395f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_not_equal_1a2ecc949982dd92dc8184dce92debef59)() const` | |
| Public static functions |
| --- |
| `[IncompatibleShapeError](#classtensorflow_1_1ops_1_1_not_equal_1ac67e5138b93ca9343e699837576f437a)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/not-equal/attrs#structtensorflow_1_1ops_1_1_not_equal_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::NotEqual::Attrs](../../../struct/tensorflow/ops/not-equal/attrs) | Optional attribute setters for [NotEqual](not-equal#classtensorflow_1_1ops_1_1_not_equal). |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### NotEqual
```
NotEqual(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### NotEqual
```
NotEqual(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
const NotEqual::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### IncompatibleShapeError
```
Attrs IncompatibleShapeError(
bool x
)
```
tensorflow_cpp tensorflow::ops::Softplus tensorflow::ops::Softplus
=========================
`#include <nn_ops.h>`
TODO: add doc.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The activations tensor.
| Constructors and Destructors |
| --- |
| `[Softplus](#classtensorflow_1_1ops_1_1_softplus_1a08f4121d171642bc34f03abb4175c89c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_softplus_1a5467c2f5d8a142fb3b963dec7ed04683)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_softplus_1ac0c01c11487ce089eacc32fb59b073ec)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_softplus_1aaf59f82fa4bf035f2da186372d3ecfd3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_softplus_1a191f5fcc73af24a68f8a89e625c3e0f9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_softplus_1a5663c0001661f989e27e40d29142dae3)() const` | |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### operation
```
Operation operation
```
Public functions
----------------
### Softplus
```
Softplus(
const ::tensorflow::Scope & scope,
::tensorflow::Input features
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Subtract tensorflow::ops::Subtract
=========================
`#include <math_ops.h>`
Returns x - y element-wise.
Summary
-------
*NOTE*: `[Subtract](subtract#classtensorflow_1_1ops_1_1_subtract)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
Aliases:
* Sub
| Constructors and Destructors |
| --- |
| `[Subtract](#classtensorflow_1_1ops_1_1_subtract_1a0f5cee058d5e214416e5a3d4d157c730)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_subtract_1a4c10676b269ddad68e102908ab0a3962)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_subtract_1a24c4e01ccf17bc018c193879242e0338)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_subtract_1a181cde6ed3838056ba31cdebcd58252d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_subtract_1aa3a8967a105ab12a10f99a2d3f88ce23)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_subtract_1afcd569ccae2779302a6cada11ffbeb69)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Subtract
```
Subtract(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Sinh tensorflow::ops::Sinh
=====================
`#include <math_ops.h>`
Computes hyperbolic sine of x element-wise.
Summary
-------
Given an input tensor, this function computes hyperbolic sine of every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `[-inf,inf]` and output range is `[-inf,inf]`.
```
x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 2, 10, float("inf")])
tf.math.sinh(x) ==> [-inf -4.0515420e+03 -5.2109528e-01 1.1752012e+00 1.5094614e+00 3.6268604e+00 1.1013232e+04 inf]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Sinh](#classtensorflow_1_1ops_1_1_sinh_1a858b848cd4213f41cd00d200ee172d66)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sinh_1a93105ee301fb80969eb476bdb33638da)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_sinh_1ada558096ec0c6a3e1775a276b4196d05)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sinh_1a471f0f546ee40901a6829259e765fc83)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sinh_1a7a599755188d6873433458bf4094bbe1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sinh_1adc39c87163a76f66a80ff2bb7193eef2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Sinh
```
Sinh(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizedConv2D tensorflow::ops::QuantizedConv2D
================================
`#include <nn_ops.h>`
Computes a 2D convolution given quantized 4D input and filter tensors.
Summary
-------
The inputs are quantized tensors where the lowest value represents the real number of the associated minimum, and the highest represents the maximum. This means that you can only interpret the quantized output in the same way, by taking the returned minimum and maximum values into account.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* filter: filter's input\_depth dimension must match input's depth dimensions.
* min\_input: The float value that the lowest quantized input value represents.
* max\_input: The float value that the highest quantized input value represents.
* min\_filter: The float value that the lowest quantized filter value represents.
* max\_filter: The float value that the highest quantized filter value represents.
* strides: The stride of the sliding window for each dimension of the input tensor.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/quantized-conv2-d/attrs#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs)`):
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output
* `[Output](../output#classtensorflow_1_1_output)` min\_output: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_output: The float value that the highest quantized output value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedConv2D](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1a8376b9a3557650a011f9c6edb484ec8b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_filter, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[QuantizedConv2D](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1aa852757615972228954f6d67b3bb8d59)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const [QuantizedConv2D::Attrs](../../../struct/tensorflow/ops/quantized-conv2-d/attrs#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[max\_output](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1a66d14c5a2888abbc7ae9e711a2fdced8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_output](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1aac559559eda7e4da378605b1b88d3320)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1a36cc12c83f91d1503e6cdeadc7e43272)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1af1401fc53bb8d0556a50807c662bbd61)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Dilations](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1ae5e27c80b00ace7bafa06479bc01ac5e)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-conv2-d/attrs#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs)` |
| `[OutType](#classtensorflow_1_1ops_1_1_quantized_conv2_d_1ad52eb17c8042ea7f90ded915f9f2aa53)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-conv2-d/attrs#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedConv2D::Attrs](../../../struct/tensorflow/ops/quantized-conv2-d/attrs) | Optional attribute setters for [QuantizedConv2D](quantized-conv2-d#classtensorflow_1_1ops_1_1_quantized_conv2_d). |
Public attributes
-----------------
### max\_output
```
::tensorflow::Output max_output
```
### min\_output
```
::tensorflow::Output min_output
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizedConv2D
```
QuantizedConv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
::tensorflow::Input min_input,
::tensorflow::Input max_input,
::tensorflow::Input min_filter,
::tensorflow::Input max_filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### QuantizedConv2D
```
QuantizedConv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
::tensorflow::Input min_input,
::tensorflow::Input max_input,
::tensorflow::Input min_filter,
::tensorflow::Input max_filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const QuantizedConv2D::Attrs & attrs
)
```
Public static functions
-----------------------
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### OutType
```
Attrs OutType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::MatrixSetDiag tensorflow::ops::MatrixSetDiag
==============================
`#include <array_ops.h>`
Returns a batched matrix tensor with new batched diagonal values.
Summary
-------
Given `input` and `diagonal`, this operation returns a tensor with the same shape and values as `input`, except for the main diagonal of the innermost matrices. These will be overwritten by the values in `diagonal`.
The output is computed as follows:
Assume `input` has `k+1` dimensions `[I, J, K, ..., M, N]` and `diagonal` has `k` dimensions `[I, J, K, ..., min(M, N)]`. Then the output is a tensor of rank `k+1` with dimensions `[I, J, K, ..., M, N]` where:
* `output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n]` for `m == n`.
* `output[i, j, k, ..., m, n] = input[i, j, k, ..., m, n]` for `m != n`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `k+1`, where `k >= 1`.
* diagonal: Rank `k`, where `k >= 1`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Rank `k+1`, with `output.shape = input.shape`.
| Constructors and Destructors |
| --- |
| `[MatrixSetDiag](#classtensorflow_1_1ops_1_1_matrix_set_diag_1af9f6deaf5d71f88356239fd1fceb3bd5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_set_diag_1ac564fb65fed63cd95c5a876d8cfcb004)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_matrix_set_diag_1a58d08deb35db4f1602c1df59432ade6c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_set_diag_1a20fc7ca0974220bfcd3a3aee08803d6c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_set_diag_1af98eee12ae5e443a923b794be760afd7)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_set_diag_1adf4b733c12f7c7dc2387318fafff0413)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MatrixSetDiag
```
MatrixSetDiag(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input diagonal
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StringLength tensorflow::ops::StringLength
=============================
`#include <string_ops.h>`
String lengths of `input`.
Summary
-------
Computes the length of each string given in the input tensor.
strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) tf.strings.length(strings).numpy() # default counts bytes array([ 5, 10, 4], dtype=int32) tf.strings.length(strings, unit="UTF8\_CHAR").numpy() array([ 5, 10, 1], dtype=int32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The strings for which to compute the length for each element.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-length/attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs)`):
* unit: The unit that is counted to compute string length. One of: `"BYTE"` (for the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 encoded Unicode code points in each string). Results are undefined if `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid UTF-8.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Integer tensor that has the same shape as `input`. The output contains the element-wise string lengths of `input`.
| Constructors and Destructors |
| --- |
| `[StringLength](#classtensorflow_1_1ops_1_1_string_length_1a7bf80700ba30572d7c7ca2b6f850eaca)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[StringLength](#classtensorflow_1_1ops_1_1_string_length_1a1a20dc90501bbdb2e17e0b5964a8eff1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [StringLength::Attrs](../../../struct/tensorflow/ops/string-length/attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_length_1a17a8867ada18bd6238863a038adb4072)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_length_1a3c952cda013f2825ee48c9cba19fa974)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_length_1a8958d29822235046d6f74f45f90f9ee2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_length_1ad02392f74af341966e713678ada76cf3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_length_1a75c524b5ff956f3f681cdebb8135460f)() const` | |
| Public static functions |
| --- |
| `[Unit](#classtensorflow_1_1ops_1_1_string_length_1af57b9def6e863b9003b3fc809a13d835)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/string-length/attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringLength::Attrs](../../../struct/tensorflow/ops/string-length/attrs) | Optional attribute setters for [StringLength](string-length#classtensorflow_1_1ops_1_1_string_length). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringLength
```
StringLength(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### StringLength
```
StringLength(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const StringLength::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Unit
```
Attrs Unit(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Inv tensorflow::ops::Inv
====================
`#include <math_ops.h>`
Computes the reciprocal of x element-wise.
Summary
-------
I.e., \(y = 1 / x\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Inv](#classtensorflow_1_1ops_1_1_inv_1ae1f280c3d74b0348a9a1334ee2e5fb37)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_inv_1af0a1f782e4ec8f16c07ecff9cee1dd88)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_inv_1a4d40bb9dea9ad8f51cd229a456377c83)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_inv_1a39f6fbdca9dacd31dcf8463c94320a7e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_inv_1a4b91956ac4ba610084ca8fb446e58230)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_inv_1a07d6f7f7c2e555cbf7c1275dc3f1c2da)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Inv
```
Inv(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AssignSub tensorflow::ops::AssignSub
==========================
`#include <state_ops.h>`
Update 'ref' by subtracting 'value' from it.
Summary
-------
This operation outputs "ref" after the update is done. This makes it easier to chain operations that need to use the reset value.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* value: The value to be subtracted to the variable.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/assign-sub/attrs#structtensorflow_1_1ops_1_1_assign_sub_1_1_attrs)`):
* use\_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as "ref". Returned as a convenience for operations that want to use the new value after the variable has been updated.
| Constructors and Destructors |
| --- |
| `[AssignSub](#classtensorflow_1_1ops_1_1_assign_sub_1a30794516fd9ad127fe4fbece311a1b71)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` |
| `[AssignSub](#classtensorflow_1_1ops_1_1_assign_sub_1a307c78fa1222456b4d159fec27e5c4f8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const [AssignSub::Attrs](../../../struct/tensorflow/ops/assign-sub/attrs#structtensorflow_1_1ops_1_1_assign_sub_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_assign_sub_1adf23f257a889a5b285aebbcfb471930b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_assign_sub_1ae757b871ebeda8e412cbbbe061f4cddb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_assign_sub_1af0b1867d0c22ccab31ccdac7daf7cbf2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_assign_sub_1adb411254bf83000c535e6b8f88119805)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_assign_sub_1a83e4daa6f284470b4f08bb7beea99533)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_assign_sub_1a3ec527b7a8c443ddc8ace66e8df0ebae)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/assign-sub/attrs#structtensorflow_1_1ops_1_1_assign_sub_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AssignSub::Attrs](../../../struct/tensorflow/ops/assign-sub/attrs) | Optional attribute setters for [AssignSub](assign-sub#classtensorflow_1_1ops_1_1_assign_sub). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### AssignSub
```
AssignSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input value
)
```
### AssignSub
```
AssignSub(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input value,
const AssignSub::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseSegmentSum tensorflow::ops::SparseSegmentSum
=================================
`#include <math_ops.h>`
Computes the sum along sparse segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Like `[SegmentSum](segment-sum#classtensorflow_1_1ops_1_1_segment_sum)`, but `segment_ids` can have rank less than `data`'s first dimension, selecting a subset of dimension 0, specified by `indices`.
For example:
```
c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
```
```
# Select two rows, one segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
# => [[0 0 0 0]]
```
```
# Select two rows, two segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
# => [[ 1 2 3 4]
# [-1 -2 -3 -4]]
```
```
# Select all rows, two segments.
tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
# => [[0 0 0 0]
# [5 6 7 8]]
```
```
# Which is equivalent to:
tf.segment_sum(c, tf.constant([0, 0, 1]))
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: A 1-D tensor. Has same rank as `segment_ids`.
* segment\_ids: A 1-D tensor. Values should be sorted and can be repeated.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SparseSegmentSum](#classtensorflow_1_1ops_1_1_sparse_segment_sum_1a02259862f31344aafc95082e08aa9aab)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_sum_1ad649884f20027c1aad55e81c08e7957b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_sum_1a40540c212fd500b0d52073ad1fc9d0c8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_sum_1a51e3e189f4da0718eca9673f4245f2b2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_sum_1a61710c54c59674e886a27a1025c266ba)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_sum_1ad6961f104657b05da798100d4ac7f68b)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentSum
```
SparseSegmentSum(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input indices,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Cast tensorflow::ops::Cast
=====================
`#include <math_ops.h>`
[Cast](cast#classtensorflow_1_1ops_1_1_cast) x of type SrcT to y of DstT.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Cast](#classtensorflow_1_1ops_1_1_cast_1a1ea2ddf55bbf88349817577e52286be9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, DataType DstT)` |
| `[Cast](#classtensorflow_1_1ops_1_1_cast_1afba1205ae1b098b241ce85a885684f29)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, DataType DstT, const [Cast::Attrs](../../../struct/tensorflow/ops/cast/attrs#structtensorflow_1_1ops_1_1_cast_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_cast_1a60a2a9aa4084fb48682fa96b49be65ee)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_cast_1a1ba2372688ef4f365cddcc1e06831536)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_cast_1a2ea230c53c61d5c0ddd1c36f63c151a4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cast_1aea4196ac1adc91b2d8938b59269c4b37)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cast_1a4bc2cec5b6d57ad59a0e89a7f94eeda1)() const` | |
| Public static functions |
| --- |
| `[Truncate](#classtensorflow_1_1ops_1_1_cast_1a82145cd417863a5aa1a282e8db95e9cc)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/cast/attrs#structtensorflow_1_1ops_1_1_cast_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Cast::Attrs](../../../struct/tensorflow/ops/cast/attrs) | Optional attribute setters for [Cast](cast#classtensorflow_1_1ops_1_1_cast). |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Cast
```
Cast(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
DataType DstT
)
```
### Cast
```
Cast(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
DataType DstT,
const Cast::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Truncate
```
Attrs Truncate(
bool x
)
```
tensorflow_cpp tensorflow::ops::Lgamma tensorflow::ops::Lgamma
=======================
`#include <math_ops.h>`
Computes the log of the absolute value of `Gamma(x)` element-wise.
Summary
-------
For positive numbers, this function computes log((input - 1)!) for every element in the tensor. `lgamma(5) = log((5-1)!) = log(4!) = log(24) = 3.1780539`
Example:
```
x = tf.constant([0, 0.5, 1, 4.5, -4, -5.6])
tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Lgamma](#classtensorflow_1_1ops_1_1_lgamma_1a150fec9302f3622dc8885f6d75980d58)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_lgamma_1aaede98d02e1e19ad09b9578d91655e12)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_lgamma_1aa40f8955ff20a832e557ea33b2b764ba)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_lgamma_1a68ff86c03e6c325c055e727edbb4486c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_lgamma_1a71994d50b4db9b4158d3b0cc2f6111d4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_lgamma_1acbf27ddfeef1916a009c8b2356ecabe6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Lgamma
```
Lgamma(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::LearnedUnigramCandidateSampler tensorflow::ops::LearnedUnigramCandidateSampler
===============================================
`#include <candidate_sampling_ops.h>`
Generates labels for candidate sampling with a learned unigram distribution.
Summary
-------
See explanations of candidate sampling and the data formats at go/candidate-sampling.
For each batch, this op picks a single set of sampled candidate labels.
The advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* true\_classes: A batch\_size \* num\_true matrix, in which each row contains the IDs of the num\_true target\_classes in the corresponding original label.
* num\_true: Number of true labels per context.
* num\_sampled: Number of candidates to randomly sample.
* unique: If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.
* range\_max: The sampler will sample integers from the interval [0, range\_max).
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/learned-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs)`):
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sampled\_candidates: A vector of length num\_sampled, in which each element is the ID of a sampled candidate.
* `[Output](../output#classtensorflow_1_1_output)` true\_expected\_count: A batch\_size \* num\_true matrix, representing the number of times each candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
* `[Output](../output#classtensorflow_1_1_output)` sampled\_expected\_count: A vector of length num\_sampled, for each sampled candidate representing the number of times the candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
| Constructors and Destructors |
| --- |
| `[LearnedUnigramCandidateSampler](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1a7c50027fcf319a0ac7abcc8af2d8861a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)` |
| `[LearnedUnigramCandidateSampler](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1aaddf15821aae74450fc3b415e18376a9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const [LearnedUnigramCandidateSampler::Attrs](../../../struct/tensorflow/ops/learned-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1a446093e6e23377b91e9335fb0b762ef7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sampled\_candidates](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1a590ac067c5a83a4dba8105564bc56b88)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sampled\_expected\_count](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1ab7da3d1ba0800e7229aedb76fafaae7b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[true\_expected\_count](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1a91c0061329f572532d581b4175a2a8c6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1a7993b832d420f9ac8835e0070689ea0d)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/learned-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1a043a0a13bbd736a96b60b0a030061638)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/learned-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::LearnedUnigramCandidateSampler::Attrs](../../../struct/tensorflow/ops/learned-unigram-candidate-sampler/attrs) | Optional attribute setters for [LearnedUnigramCandidateSampler](learned-unigram-candidate-sampler#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sampled\_candidates
```
::tensorflow::Output sampled_candidates
```
### sampled\_expected\_count
```
::tensorflow::Output sampled_expected_count
```
### true\_expected\_count
```
::tensorflow::Output true_expected_count
```
Public functions
----------------
### LearnedUnigramCandidateSampler
```
LearnedUnigramCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max
)
```
### LearnedUnigramCandidateSampler
```
LearnedUnigramCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max,
const LearnedUnigramCandidateSampler::Attrs & attrs
)
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::AddSparseToTensorsMap tensorflow::ops::AddSparseToTensorsMap
======================================
`#include <sparse_ops.h>`
[Add](add#classtensorflow_1_1ops_1_1_add) a `SparseTensor` to a `SparseTensorsMap` return its handle.
Summary
-------
A `SparseTensor` is represented by three tensors: `sparse_indices`, `sparse_values`, and `sparse_shape`.
This operator takes the given `SparseTensor` and adds it to a container object (a `SparseTensorsMap`). A unique key within this container is generated in the form of an `int64`, and this is the value that is returned.
The `SparseTensor` can then be read out as part of a minibatch by passing the key as a vector element to `[TakeManySparseFromTensorsMap](take-many-sparse-from-tensors-map#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map)`. To ensure the correct `SparseTensorsMap` is accessed, ensure that the same `container` and `shared_name` are passed to that Op. If no `shared_name` is provided here, instead use the *name* of the [Operation](../operation#classtensorflow_1_1_operation) created by calling `[AddSparseToTensorsMap](add-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map)` as the `shared_name` passed to `[TakeManySparseFromTensorsMap](take-many-sparse-from-tensors-map#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map)`. Ensure the Operations are colocated.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sparse\_indices: 2-D. The `indices` of the `SparseTensor`.
* sparse\_values: 1-D. The `values` of the `SparseTensor`.
* sparse\_shape: 1-D. The `shape` of the `SparseTensor`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)`):
* container: The container name for the `SparseTensorsMap` created by this op.
* shared\_name: The shared name for the `SparseTensorsMap` created by this op. If blank, the new [Operation](../operation#classtensorflow_1_1_operation)'s unique name is used.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 0-D. The handle of the `SparseTensor` now stored in the `SparseTensorsMap`.
| Constructors and Destructors |
| --- |
| `[AddSparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a19db933f8fd5d01db12d8b59d63bf06a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape)` |
| `[AddSparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1aff3889e43d0d729ad526a005889b5626)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape, const [AddSparseToTensorsMap::Attrs](../../../struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a3c43523211fb26d79e4d22b5149c4029)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sparse\_handle](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a48d455f05445afe51dff6364bb8968c8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a416c237556b0e60bf15c9df4fcb04da1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a02d4fe7f3659971c2cb8e26287ed407e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a738ce7832c4e4854e1988426e9f3d0f7)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a8d3e3d5c6cf3b841ecbbc82322d94a89)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1accd0cca1251e1cf70fe8c4d9498dd117)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AddSparseToTensorsMap::Attrs](../../../struct/tensorflow/ops/add-sparse-to-tensors-map/attrs) | Optional attribute setters for [AddSparseToTensorsMap](add-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sparse\_handle
```
::tensorflow::Output sparse_handle
```
Public functions
----------------
### AddSparseToTensorsMap
```
AddSparseToTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape
)
```
### AddSparseToTensorsMap
```
AddSparseToTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape,
const AddSparseToTensorsMap::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::NoOp tensorflow::ops::NoOp
=====================
`#include <no_op.h>`
Does nothing.
Summary
-------
Only useful as a placeholder for control edges.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[NoOp](#classtensorflow_1_1ops_1_1_no_op_1a1a6e2fe5f04873dde3ca03ab51f67632)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_no_op_1a19874b9a430f2f572abca52e299a8379)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_no_op_1a2c8ac1e31e0da468c2ee58b5c671aa55)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### NoOp
```
NoOp(
const ::tensorflow::Scope & scope
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::Save tensorflow::ops::Save
=====================
`#include <io_ops.h>`
Saves the input tensors to disk.
Summary
-------
The size of `tensor_names` must match the number of tensors in `data`. `data[i]` is written to `filename` with name `tensor_names[i]`.
See also `[SaveSlices](save-slices#classtensorflow_1_1ops_1_1_save_slices)`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* filename: Must have a single element. The name of the file to which we write the tensor.
* tensor\_names: Shape `[N]`. The names of the tensors to be saved.
* data: `N` tensors to save.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[Save](#classtensorflow_1_1ops_1_1_save_1a64a5b93d315ac9308651354692ae8825)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filename, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_names, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_save_1a260f7c4261ccc370e0d48726e9c017a9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_save_1ab957aaf2009c689e9bb7432c7194cd1e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### Save
```
Save(
const ::tensorflow::Scope & scope,
::tensorflow::Input filename,
::tensorflow::Input tensor_names,
::tensorflow::InputList data
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::StringToHashBucketFast tensorflow::ops::StringToHashBucketFast
=======================================
`#include <string_ops.h>`
Converts each string in the input [Tensor](../tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets.
Summary
-------
The hash function is deterministic on the content of the string within the process and will never change. However, it is not suitable for cryptography. This function may be used when CPU time is scarce and inputs are trusted or unimportant. There is a risk of adversaries constructing inputs that all hash to the same bucket. To prevent this problem, use a strong hash function with `tf.string_to_hash_bucket_strong`.
Examples:
tf.strings.to\_hash\_bucket\_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() array([0, 2, 2])
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The strings to assign a hash bucket.
* num\_buckets: The number of buckets.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) of the same shape as the input `string_tensor`.
| Constructors and Destructors |
| --- |
| `[StringToHashBucketFast](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1aeb05e5b10fdc6f834f05a653d410f7f7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, int64 num_buckets)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1a0952b49db809f413e63d82b3f012df4f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1a18fa68753ab137a6da6fdd02e1eca30f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1ae3368d6c128d5c8bd06c2ba972391f6e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1adc1ece493cd1b706ea7d316631c56148)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1a0a330a80b9f8aa32ee15556dd3e68aa4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringToHashBucketFast
```
StringToHashBucketFast(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
int64 num_buckets
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::TensorArrayWrite tensorflow::ops::TensorArrayWrite
=================================
`#include <data_flow_ops.h>`
Push an element onto the tensor\_array.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* index: The position to write to inside the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* value: The tensor to write to the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* flow\_in: A float scalar that enforces proper chaining of operations.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A float scalar that enforces proper chaining of operations.
| Constructors and Destructors |
| --- |
| `[TensorArrayWrite](#classtensorflow_1_1ops_1_1_tensor_array_write_1a460b6a43f14c176075205066d313b90a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) index, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in)` |
| Public attributes |
| --- |
| `[flow\_out](#classtensorflow_1_1ops_1_1_tensor_array_write_1aa092851909387a37b7c3a387a8af44e1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_write_1a3100a9efbca22b5bba4584019701be7a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_array_write_1abeffa6d8bb7c744eec782cbaa5558bf8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_array_write_1add6a075334d0dfdc712f3a3a3d346be8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_array_write_1a5d52808083b6de9fcf870cccf2c24647)() const` | |
Public attributes
-----------------
### flow\_out
```
::tensorflow::Output flow_out
```
### operation
```
Operation operation
```
Public functions
----------------
### TensorArrayWrite
```
TensorArrayWrite(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input index,
::tensorflow::Input value,
::tensorflow::Input flow_in
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Max tensorflow::ops::Max
====================
`#include <math_ops.h>`
Computes the maximum of elements across dimensions of a tensor.
Summary
-------
Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The tensor to reduce.
* axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max/attrs#structtensorflow_1_1ops_1_1_max_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor.
Aliases:
* ReduceMax
| Constructors and Destructors |
| --- |
| `[Max](#classtensorflow_1_1ops_1_1_max_1ab6eb5c5cf3ec05fb17100a63ab184b9d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[Max](#classtensorflow_1_1ops_1_1_max_1a4917bd2393a5aeabc5549e216f28e295)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Max::Attrs](../../../struct/tensorflow/ops/max/attrs#structtensorflow_1_1ops_1_1_max_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_1a4f664e2282bdf700c1981a160ece7c9e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_1aa89ae019f795b0a71f4a5d16a73ea669)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_1a4d721922254ff1394832ee6119a1835e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_1a9ba68be543561fe5cf21512f7395b8e3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_1af28e78785e1db66ee949c3338aebd594)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_max_1af4ce8513e298223e3e7b4d91b392fe04)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/max/attrs#structtensorflow_1_1ops_1_1_max_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Max::Attrs](../../../struct/tensorflow/ops/max/attrs) | Optional attribute setters for [Max](max#classtensorflow_1_1ops_1_1_max). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Max
```
Max(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis
)
```
### Max
```
Max(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis,
const Max::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::QueueDequeue tensorflow::ops::QueueDequeue
=============================
`#include <data_flow_ops.h>`
Dequeues a tuple of one or more tensors from the given queue.
Summary
-------
This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple.
N.B. If the queue is empty, this operation will block until an element has been dequeued (or 'timeout\_ms' elapses, if specified).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
* component\_types: The type of each component in a tuple.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/queue-dequeue/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_1_1_attrs)`):
* timeout\_ms: If the queue is empty, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet.
Returns:
* `OutputList`: One or more tensors that were dequeued as a tuple.
| Constructors and Destructors |
| --- |
| `[QueueDequeue](#classtensorflow_1_1ops_1_1_queue_dequeue_1a62ecaf858cb38bae134e075e91560201)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, const DataTypeSlice & component_types)` |
| `[QueueDequeue](#classtensorflow_1_1ops_1_1_queue_dequeue_1a7e6e32c8f0de0748262a87379f34d80f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, const DataTypeSlice & component_types, const [QueueDequeue::Attrs](../../../struct/tensorflow/ops/queue-dequeue/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[components](#classtensorflow_1_1ops_1_1_queue_dequeue_1add6442c38a956524521d2dc78b0392bd)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_queue_dequeue_1a0cc196f365364b3cb85ad67b926c6320)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_queue_dequeue_1adab23cc206d2a2d84d80cb9cbaaab043)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[TimeoutMs](#classtensorflow_1_1ops_1_1_queue_dequeue_1a369b19de112a05e7793c51bd74ae6e43)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/queue-dequeue/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QueueDequeue::Attrs](../../../struct/tensorflow/ops/queue-dequeue/attrs) | Optional attribute setters for [QueueDequeue](queue-dequeue#classtensorflow_1_1ops_1_1_queue_dequeue). |
Public attributes
-----------------
### components
```
::tensorflow::OutputList components
```
### operation
```
Operation operation
```
Public functions
----------------
### QueueDequeue
```
QueueDequeue(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
const DataTypeSlice & component_types
)
```
### QueueDequeue
```
QueueDequeue(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
const DataTypeSlice & component_types,
const QueueDequeue::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### TimeoutMs
```
Attrs TimeoutMs(
int64 x
)
```
tensorflow_cpp tensorflow::ops::MatrixDiagV2 tensorflow::ops::MatrixDiagV2
=============================
`#include <array_ops.h>`
Returns a batched diagonal tensor with given batched diagonal values.
Summary
-------
Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th diagonals of a matrix, with everything else padded with `padding`. `num_rows` and `num_cols` specify the dimension of the innermost matrix of the output. If both are not specified, the op assumes the innermost matrix is square and infers its size from `k` and the innermost dimension of `diagonal`. If only one of them is specified, the op assumes the unspecified value is the smallest possible based on other criteria.
Let `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has rank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one diagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank `r` with shape `[I, J, ..., L, num_rows, num_cols]`.
The second innermost dimension of `diagonal` has double meaning. When `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size [I, J, ..., M], and the output tensor is:
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
padding_value ; otherwise
```
Otherwise, `M` is treated as the number of diagonals for the matrix in the same batch (`M = k[1]-k[0]+1`), and the output tensor is:
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
padding_value ; otherwise
```
where `d = n - m`
, `diag_index = k[1] - d`
, and `index_in_diag = n - max(d, 0)`
. For example:
```
# The main diagonal.
diagonal = np.array([[1, 2, 3, 4], # Input shape: (2, 4)
[5, 6, 7, 8]])
tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0], # Output shape: (2, 4, 4)
[0, 2, 0, 0],
[0, 0, 3, 0],
[0, 0, 0, 4]],
[[5, 0, 0, 0],
[0, 6, 0, 0],
[0, 0, 7, 0],
[0, 0, 0, 8]]]
```
```
# A superdiagonal (per batch).
diagonal = np.array([[1, 2, 3], # Input shape: (2, 3)
[4, 5, 6]])
tf.matrix_diag(diagonal, k = 1)
==> [[[0, 1, 0, 0], # Output shape: (2, 4, 4)
[0, 0, 2, 0],
[0, 0, 0, 3],
[0, 0, 0, 0]],
[[0, 4, 0, 0],
[0, 0, 5, 0],
[0, 0, 0, 6],
[0, 0, 0, 0]]]
```
```
# A band of diagonals.
diagonals = np.array([[[1, 2, 3], # Input shape: (2, 2, 3)
[4, 5, 0]],
[[6, 7, 9],
[9, 1, 0]]])
tf.matrix_diag(diagonals, k = (-1, 0))
==> [[[1, 0, 0], # Output shape: (2, 3, 3)
[4, 2, 0],
[0, 5, 3]],
[[6, 0, 0],
[9, 7, 0],
[0, 1, 9]]]
```
```
# Rectangular matrix.
diagonal = np.array([1, 2]) # Input shape: (2)
tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
==> [[0, 0, 0, 0], # Output shape: (3, 4)
[1, 0, 0, 0],
[0, 2, 0, 0]]
```
```
# Rectangular matrix with inferred num_cols and padding_value = 9.
tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
==> [[9, 9], # Output shape: (3, 2)
[1, 9],
[9, 2]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* diagonal: Rank `r`, where `r >= 1`
* k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. `k[0]` must not be larger than `k[1]`.
* num\_rows: The number of rows of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of `diagonal`.
* num\_cols: The number of columns of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of `diagonal`.
* padding\_value: The number to fill the area outside the specified diagonal band with. Default is 0.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has rank `r+1` when `k` is an integer or `k[0] == k[1]`, rank `r` otherwise.
| Constructors and Destructors |
| --- |
| `[MatrixDiagV2](#classtensorflow_1_1ops_1_1_matrix_diag_v2_1a0f4757e436efeaed1ba2bd9690367b7f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_rows, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_cols, ::[tensorflow::Input](../input#classtensorflow_1_1_input) padding_value)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_diag_v2_1a09bb44acf7362d90e9b70dfaa3ebd8fd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_matrix_diag_v2_1a180f0e2069ba614f9a8bf4593d6b322a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_diag_v2_1a5faf264fc6c643dfc49d1d5b00828973)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_diag_v2_1a8301ec1ffa503e41034e06b9fc8dfd93)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_diag_v2_1a96f20bc6c061cadeeb30e3986311fc2c)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MatrixDiagV2
```
MatrixDiagV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input diagonal,
::tensorflow::Input k,
::tensorflow::Input num_rows,
::tensorflow::Input num_cols,
::tensorflow::Input padding_value
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::DynamicPartition tensorflow::ops::DynamicPartition
=================================
`#include <data_flow_ops.h>`
Partitions `data` into `num_partitions` tensors using indices from `partitions`.
Summary
-------
For each index tuple `js` of size `partitions.ndim`, the slice `data[js, ...]` becomes part of `outputs[partitions[js]]`. The slices with `partitions[js] = i` are placed in `outputs[i]` in lexicographic order of `js`, and the first dimension of `outputs[i]` is the number of entries in `partitions` equal to `i`. In detail,
```
outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
```
```
outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
```
`data.shape` must start with `partitions.shape`.
For example:
```
# Scalar partitions.
partitions = 1
num_partitions = 2
data = [10, 20]
outputs[0] = [] # Empty with shape [0, 2]
outputs[1] = [[10, 20]]
```
```
# Vector partitions.
partitions = [0, 0, 1, 1, 0]
num_partitions = 2
data = [10, 20, 30, 40, 50]
outputs[0] = [10, 20, 50]
outputs[1] = [30, 40]
```
See `dynamic_stitch` for an example on how to merge partitions back.

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* partitions: [Any](any#classtensorflow_1_1ops_1_1_any) shape. Indices in the range `[0, num_partitions)`.
* num\_partitions: The number of partitions to output.
Returns:
* `OutputList`: The outputs tensor.
| Constructors and Destructors |
| --- |
| `[DynamicPartition](#classtensorflow_1_1ops_1_1_dynamic_partition_1a3054ef5ab4e012816521a61a98ff1cb8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) partitions, int64 num_partitions)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_dynamic_partition_1ae34cf25c6a4f479e6eab33dd8d6c7bca)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[outputs](#classtensorflow_1_1ops_1_1_dynamic_partition_1ac93870bad9fb8ccd554d368930d608c0)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_dynamic_partition_1a69567b14d471387c73d2e2240c59d645)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### outputs
```
::tensorflow::OutputList outputs
```
Public functions
----------------
### DynamicPartition
```
DynamicPartition(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input partitions,
int64 num_partitions
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVarsGradient tensorflow::ops::FakeQuantWithMinMaxVarsGradient
================================================
`#include <array_ops.h>`
Compute gradients for a [FakeQuantWithMinMaxVars](fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* gradients: Backpropagated gradients above the [FakeQuantWithMinMaxVars](fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation.
* inputs: Values passed as inputs to the [FakeQuantWithMinMaxVars](fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation. min, max: Quantization interval, scalar floats.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs)`):
* num\_bits: The bitwidth of the quantization; between 2 and 8, inclusive.
* narrow\_range: Whether to quantize into 2^num\_bits - 1 distinct values.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` backprops\_wrt\_input: Backpropagated gradients w.r.t. inputs: `gradients * (inputs >= min && inputs <= max)`.
* `[Output](../output#classtensorflow_1_1_output)` backprop\_wrt\_min: Backpropagated gradients w.r.t. min parameter: `sum(gradients * (inputs < min))`.
* `[Output](../output#classtensorflow_1_1_output)` backprop\_wrt\_max: Backpropagated gradients w.r.t. max parameter: `sum(gradients * (inputs > max))`.
| Constructors and Destructors |
| --- |
| `[FakeQuantWithMinMaxVarsGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1ad9be97a8137f00d7e54153251f4f62ea)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max)` |
| `[FakeQuantWithMinMaxVarsGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1a11b1c942c92067ddafc4db678f6d85b7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max, const [FakeQuantWithMinMaxVarsGradient::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[backprop\_wrt\_max](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1abf26c1c7473251c45c87afadedb09d0a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[backprop\_wrt\_min](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1a5230729c290e5cdc02a6498499e3214d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[backprops\_wrt\_input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1a2df281b7207f270927b8666d5af881dc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1a916fa0e07f7154a9b6a1d1fa6b9e1ead)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1a60218fbba17b3acc458fd338852f0764)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1abbc87cb92b40cc087db232df595ab001)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars-gradient/attrs) | Optional attribute setters for [FakeQuantWithMinMaxVarsGradient](fake-quant-with-min-max-vars-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient). |
Public attributes
-----------------
### backprop\_wrt\_max
```
::tensorflow::Output backprop_wrt_max
```
### backprop\_wrt\_min
```
::tensorflow::Output backprop_wrt_min
```
### backprops\_wrt\_input
```
::tensorflow::Output backprops_wrt_input
```
### operation
```
Operation operation
```
Public functions
----------------
### FakeQuantWithMinMaxVarsGradient
```
FakeQuantWithMinMaxVarsGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input inputs,
::tensorflow::Input min,
::tensorflow::Input max
)
```
### FakeQuantWithMinMaxVarsGradient
```
FakeQuantWithMinMaxVarsGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input inputs,
::tensorflow::Input min,
::tensorflow::Input max,
const FakeQuantWithMinMaxVarsGradient::Attrs & attrs
)
```
Public static functions
-----------------------
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
tensorflow_cpp tensorflow::ops::UniformCandidateSampler tensorflow::ops::UniformCandidateSampler
========================================
`#include <candidate_sampling_ops.h>`
Generates labels for candidate sampling with a uniform distribution.
Summary
-------
See explanations of candidate sampling and the data formats at go/candidate-sampling.
For each batch, this op picks a single set of sampled candidate labels.
The advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* true\_classes: A batch\_size \* num\_true matrix, in which each row contains the IDs of the num\_true target\_classes in the corresponding original label.
* num\_true: Number of true labels per context.
* num\_sampled: Number of candidates to randomly sample.
* unique: If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.
* range\_max: The sampler will sample integers from the interval [0, range\_max).
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs)`):
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sampled\_candidates: A vector of length num\_sampled, in which each element is the ID of a sampled candidate.
* `[Output](../output#classtensorflow_1_1_output)` true\_expected\_count: A batch\_size \* num\_true matrix, representing the number of times each candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
* `[Output](../output#classtensorflow_1_1_output)` sampled\_expected\_count: A vector of length num\_sampled, for each sampled candidate representing the number of times the candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
| Constructors and Destructors |
| --- |
| `[UniformCandidateSampler](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1ad2bca936da372c0e3b0c1034e58fd615)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)` |
| `[UniformCandidateSampler](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1ab2a187f26b0545b64a13998b2f018b97)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const [UniformCandidateSampler::Attrs](../../../struct/tensorflow/ops/uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1af2660b86dea858727b0fd8632a95f9b1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sampled\_candidates](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1af3d782eae21114420811a2d086119c62)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sampled\_expected\_count](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1ad7fee9c79ce2eeda957df1c7391ffa6e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[true\_expected\_count](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1ad4f7c5007b8d17da8df140ec7504f27c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1adf25acd2bcc151e64950e3f5c8c28cfc)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_uniform_candidate_sampler_1adcfc0127820c98af53712f4080e6f863)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::UniformCandidateSampler::Attrs](../../../struct/tensorflow/ops/uniform-candidate-sampler/attrs) | Optional attribute setters for [UniformCandidateSampler](uniform-candidate-sampler#classtensorflow_1_1ops_1_1_uniform_candidate_sampler). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sampled\_candidates
```
::tensorflow::Output sampled_candidates
```
### sampled\_expected\_count
```
::tensorflow::Output sampled_expected_count
```
### true\_expected\_count
```
::tensorflow::Output true_expected_count
```
Public functions
----------------
### UniformCandidateSampler
```
UniformCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max
)
```
### UniformCandidateSampler
```
UniformCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max,
const UniformCandidateSampler::Attrs & attrs
)
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyKerasMomentum tensorflow::ops::ResourceSparseApplyKerasMomentum
=================================================
`#include <training_ops.h>`
Update relevant entries in '\*var' and '\*accum' according to the momentum scheme.
Summary
-------
Set use\_nesterov = True if you want to use Nesterov momentum.
That is for rows we have grad for, we update var and accum as follows:
accum = accum \* momentum - lr \* grad var += accum
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* momentum: Momentum. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
* use\_nesterov: If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyKerasMomentum](#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1af5528208d48a551bfe3ecf447f27a8e0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum)` |
| `[ResourceSparseApplyKerasMomentum](#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1a7afb417884c186a48f70dcfeac5d4394)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, const [ResourceSparseApplyKerasMomentum::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1a58bc4e118977ebd79a8548322b20f7b9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1a200379fccb879b6992be30ff8b702a3a)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1a0ed18393806389dac75596ac30d2a7bc)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs)` |
| `[UseNesterov](#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1a87e697f5363e381c3318f6bb1223cdd4)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs) | Optional attribute setters for [ResourceSparseApplyKerasMomentum](resource-sparse-apply-keras-momentum#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyKerasMomentum
```
ResourceSparseApplyKerasMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input momentum
)
```
### ResourceSparseApplyKerasMomentum
```
ResourceSparseApplyKerasMomentum(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input momentum,
const ResourceSparseApplyKerasMomentum::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
### UseNesterov
```
Attrs UseNesterov(
bool x
)
```
tensorflow_cpp tensorflow::ops::ReaderRead tensorflow::ops::ReaderRead
===========================
`#include <io_ops.h>`
Returns the next record (key, value pair) produced by a Reader.
Summary
-------
Will dequeue from the input queue if necessary (e.g. when the Reader needs to start reading from a new file since it has finished with the previous file).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a Reader.
* queue\_handle: Handle to a Queue, with string work items.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` key: A scalar.
* `[Output](../output#classtensorflow_1_1_output)` value: A scalar.
| Constructors and Destructors |
| --- |
| `[ReaderRead](#classtensorflow_1_1ops_1_1_reader_read_1a7d1eef47d4a87dceeded2d6750e7cb0e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) queue_handle)` |
| Public attributes |
| --- |
| `[key](#classtensorflow_1_1ops_1_1_reader_read_1a0d1111765b2bd6b3cbab0cbe8fe599f5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_reader_read_1af68b5bdc62c28936b77f59faa6864a47)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[value](#classtensorflow_1_1ops_1_1_reader_read_1a80683cdf25825be1e931e1def4ac07bb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### key
```
::tensorflow::Output key
```
### operation
```
Operation operation
```
### value
```
::tensorflow::Output value
```
Public functions
----------------
### ReaderRead
```
ReaderRead(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle,
::tensorflow::Input queue_handle
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::LogicalOr tensorflow::ops::LogicalOr
==========================
`#include <math_ops.h>`
Returns the truth value of x OR y element-wise.
Summary
-------
*NOTE*: `[LogicalOr](logical-or#classtensorflow_1_1ops_1_1_logical_or)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[LogicalOr](#classtensorflow_1_1ops_1_1_logical_or_1a047bdf4d94ea8f717331b7cbc032fbd7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_logical_or_1aea137d60fb01184a72027ef9318f389a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_logical_or_1a11a6435e04b7e5e520e7d9200ceba0e1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_logical_or_1a9a3b4cd639c64193a8037c0874a26325)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_logical_or_1a62b35c5cbb49be6b284503ba304c4c60)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_logical_or_1a909ed6b64eea37fd75e15651c124c0a6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### LogicalOr
```
LogicalOr(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Acosh tensorflow::ops::Acosh
======================
`#include <math_ops.h>`
Computes inverse hyperbolic cosine of x element-wise.
Summary
-------
Given an input tensor, the function computes inverse hyperbolic cosine of every element. [Input](../input#classtensorflow_1_1_input) range is `[1, inf]`. It returns `nan` if the input lies outside the range.
```
x = tf.constant([-2, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.acosh(x) ==> [nan nan 0. 0.62236255 5.9914584 9.903487 inf]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Acosh](#classtensorflow_1_1ops_1_1_acosh_1a31b3474b5d1e71240fe6088301abf0a5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_acosh_1aa991cae2b2e8e5c5ba714a927be34d8c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_acosh_1a5afe6daf80428d88039349ebf210c1cf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_acosh_1a21ed3b868b1295f99f00438352ce0ac9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_acosh_1a45294a289edf40798c124ba4de38e96c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_acosh_1a10bde9ae4d7770247d77d86b34da6752)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Acosh
```
Acosh(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Diag tensorflow::ops::Diag
=====================
`#include <array_ops.h>`
Returns a diagonal tensor with a given diagonal values.
Summary
-------
Given a `diagonal`, this operation returns a tensor with the `diagonal` and everything else padded with zeros. The diagonal is computed as follows:
Assume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of rank 2k with dimensions [D1,..., Dk, D1,..., Dk] where:
`output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else.
For example:
```
# 'diagonal' is [1, 2, 3, 4]
tf.diag(diagonal) ==> [[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* diagonal: Rank k tensor where k is at most 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Diag](#classtensorflow_1_1ops_1_1_diag_1a5beb111139305546f475c8687a35ce26)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_diag_1a051fe6a94969df559f77f9da31685e59)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_diag_1a0928ff530cf6fe0c4b3f4f1e6e1a419b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_diag_1a53b2f11c3a488f759bd883f16f5bbbf2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_diag_1ac6d654e5b82ac6954ce4b60948da65d9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_diag_1ae8e07573b96ad7b6b69b9c4d4d4016d8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Diag
```
Diag(
const ::tensorflow::Scope & scope,
::tensorflow::Input diagonal
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FusedResizeAndPadConv2D tensorflow::ops::FusedResizeAndPadConv2D
========================================
`#include <nn_ops.h>`
Performs a resize and padding as a preprocess during a convolution.
Summary
-------
It's often possible to do spatial transformations more efficiently as part of the packing stage of a convolution, so this op allows for an optimized implementation where these stages are fused together. This prevents the need to write out the intermediate results as whole tensors, reducing memory pressure, and we can get some latency gains by merging the transformation calculations. The data\_format attribute for [Conv2D](conv2-d#classtensorflow_1_1ops_1_1_conv2_d) isn't supported by this op, and defaults to 'NHWC' order. Internally this op uses a single per-graph scratch buffer, which means that it will block if multiple versions are being run in parallel. This is because this operator is primarily an optimization to minimize memory usage.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, in_height, in_width, in_channels]`.
* size: A 1-D int32 [Tensor](../tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.
* paddings: A two-column matrix specifying the padding sizes. The number of rows must be the same as the rank of `input`.
* filter: 4-D with shape `[filter_height, filter_width, in_channels, out_channels]`.
* strides: 1-D of length 4. The stride of the sliding window for each dimension of `input`. Must be in the same order as the dimension specified with format.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs)`):
* resize\_align\_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[FusedResizeAndPadConv2D](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1afdac6e55ba14082f1b161c3892feb79c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) paddings, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, StringPiece mode, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[FusedResizeAndPadConv2D](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ab05dac1d726214f232015fa7696ee523)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) paddings, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, StringPiece mode, const gtl::ArraySlice< int > & strides, StringPiece padding, const [FusedResizeAndPadConv2D::Attrs](../../../struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1a452db77c1530086287369d18c4e67196)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ad8619b45c03b5aa399ef784c4b5d96a5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ad006395b5772a9dad02d7e8aec083755)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1ad64d511881de03b3de360bc2d09af397)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1a0ae5c811852f315f2b5cc87682ca69a3)() const` | |
| Public static functions |
| --- |
| `[ResizeAlignCorners](#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1a26a1da31c5f264b43033f67ce65063c0)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedResizeAndPadConv2D::Attrs](../../../struct/tensorflow/ops/fused-resize-and-pad-conv2-d/attrs) | Optional attribute setters for [FusedResizeAndPadConv2D](fused-resize-and-pad-conv2-d#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### FusedResizeAndPadConv2D
```
FusedResizeAndPadConv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input size,
::tensorflow::Input paddings,
::tensorflow::Input filter,
StringPiece mode,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### FusedResizeAndPadConv2D
```
FusedResizeAndPadConv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input size,
::tensorflow::Input paddings,
::tensorflow::Input filter,
StringPiece mode,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const FusedResizeAndPadConv2D::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### ResizeAlignCorners
```
Attrs ResizeAlignCorners(
bool x
)
```
tensorflow_cpp tensorflow::ops::ComplexAbs tensorflow::ops::ComplexAbs
===========================
`#include <math_ops.h>`
Computes the complex absolute value of a tensor.
Summary
-------
Given a tensor `x` of complex numbers, this operation returns a tensor of type `float` or `double` that is the absolute value of each element in `x`. [All](all#classtensorflow_1_1ops_1_1_all) elements in `x` must be complex numbers of the form \(a + bj\). The absolute value is computed as \( \sqrt{a^2 + b^2}\).
For example:
x = tf.complex(3.0, 4.0) print((tf.raw\_ops.ComplexAbs(x=x, Tout=tf.dtypes.float32, name=None)).numpy()) 5.0
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[ComplexAbs](#classtensorflow_1_1ops_1_1_complex_abs_1ae9a8ff8e40f2b268efeb2cbf52eb00c9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| `[ComplexAbs](#classtensorflow_1_1ops_1_1_complex_abs_1ae1f3cbfd4330b1a2b1bd0bb7d20aaa7e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, const [ComplexAbs::Attrs](../../../struct/tensorflow/ops/complex-abs/attrs#structtensorflow_1_1ops_1_1_complex_abs_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_complex_abs_1a6339381a61011992fd1de7df2195c9dc)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_complex_abs_1a4aac4710658d4d29694592675b9ed213)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_complex_abs_1aeaf0e98583b3d60a726ebf29e7541d17)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_complex_abs_1a5590861b4175946a8e4ebff58d9e8f29)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_complex_abs_1a81aea0f48f1416e116c66bb7111b1272)() const` | |
| Public static functions |
| --- |
| `[Tout](#classtensorflow_1_1ops_1_1_complex_abs_1af17c93749b98b61e134f43532f100da1)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/complex-abs/attrs#structtensorflow_1_1ops_1_1_complex_abs_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ComplexAbs::Attrs](../../../struct/tensorflow/ops/complex-abs/attrs) | Optional attribute setters for [ComplexAbs](complex-abs#classtensorflow_1_1ops_1_1_complex_abs). |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### ComplexAbs
```
ComplexAbs(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### ComplexAbs
```
ComplexAbs(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
const ComplexAbs::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Tout
```
Attrs Tout(
DataType x
)
```
tensorflow_cpp tensorflow::ops::TensorArrayConcat tensorflow::ops::TensorArrayConcat
==================================
`#include <data_flow_ops.h>`
[Concat](concat#classtensorflow_1_1ops_1_1_concat) the elements from the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into value `value`.
Summary
-------
Takes `T` elements of shapes
```
(n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...)
```
and concatenates them into a [Tensor](../tensor#classtensorflow_1_1_tensor) of shape:
```(n0 + n1 + ... + n(T-1) x d0 x d1 x ...)
```
All elements must have the same shape (excepting the first dimension).
```
```
Args:
* scope: A Scope object
* handle: The handle to a TensorArray.
* flow_in: A float scalar that enforces proper chaining of operations.
* dtype: The type of the elem that is returned.
```
```
Optional attributes (see Attrs):
* element_shape_except0: The expected shape of an element, if known,
excluding the first dimension. Used to validate the shapes of
TensorArray elements. If this shape is not fully specified, concatenating
zero-size TensorArrays is an error.
```
```
Returns:
* Output value: All of the elements in the TensorArray, concatenated along the first
axis.
* Output lengths: A vector of the row sizes of the original T elements in the
value output. In the example above, this would be the values:
(n1, n2, ..., n(T-1)).
```
| Constructors and Destructors |
| --- |
| `[TensorArrayConcat](#classtensorflow_1_1ops_1_1_tensor_array_concat_1aab54b53cc7e1c5f65154a9ab7a3a2b6f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, DataType dtype)` |
| `[TensorArrayConcat](#classtensorflow_1_1ops_1_1_tensor_array_concat_1adce330002ce711626c4b067bca8eb40e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, DataType dtype, const [TensorArrayConcat::Attrs](../../../struct/tensorflow/ops/tensor-array-concat/attrs#structtensorflow_1_1ops_1_1_tensor_array_concat_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[lengths](#classtensorflow_1_1ops_1_1_tensor_array_concat_1af3dca4f4a395a0bb0702e092086e7b03)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_concat_1a680b113e26c09068a4f01c01f797b085)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[value](#classtensorflow_1_1ops_1_1_tensor_array_concat_1a636fe92f677b9f2e9d667fa338837b4e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[ElementShapeExcept0](#classtensorflow_1_1ops_1_1_tensor_array_concat_1a2e0ae98efaf62f30ca8b83f5f42baa76)(PartialTensorShape x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array-concat/attrs#structtensorflow_1_1ops_1_1_tensor_array_concat_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TensorArrayConcat::Attrs](../../../struct/tensorflow/ops/tensor-array-concat/attrs) | Optional attribute setters for [TensorArrayConcat](tensor-array-concat#classtensorflow_1_1ops_1_1_tensor_array_concat). |
Public attributes
-----------------
### lengths
```
::tensorflow::Output lengths
```
### operation
```
Operation operation
```
### value
```
::tensorflow::Output value
```
Public functions
----------------
### TensorArrayConcat
```
TensorArrayConcat(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input flow_in,
DataType dtype
)
```
### TensorArrayConcat
```
TensorArrayConcat(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input flow_in,
DataType dtype,
const TensorArrayConcat::Attrs & attrs
)
```
Public static functions
-----------------------
### ElementShapeExcept0
```
Attrs ElementShapeExcept0(
PartialTensorShape x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::MatrixDiagV3 tensorflow::ops::MatrixDiagV3
=============================
`#include <array_ops.h>`
Returns a batched diagonal tensor with given batched diagonal values.
Summary
-------
Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th diagonals of a matrix, with everything else padded with `padding`. `num_rows` and `num_cols` specify the dimension of the innermost matrix of the output. If both are not specified, the op assumes the innermost matrix is square and infers its size from `k` and the innermost dimension of `diagonal`. If only one of them is specified, the op assumes the unspecified value is the smallest possible based on other criteria.
Let `diagonal` have `r` dimensions `[I, J, ..., L, M, N]`. The output tensor has rank `r+1` with shape `[I, J, ..., L, M, num_rows, num_cols]` when only one diagonal is given (`k` is an integer or `k[0] == k[1]`). Otherwise, it has rank `r` with shape `[I, J, ..., L, num_rows, num_cols]`.
The second innermost dimension of `diagonal` has double meaning. When `k` is scalar or `k[0] == k[1]`, `M` is part of the batch size [I, J, ..., M], and the output tensor is:
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
padding_value ; otherwise
```
Otherwise, `M` is treated as the number of diagonals for the matrix in the same batch (`M = k[1]-k[0]+1`), and the output tensor is:
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
padding_value ; otherwise
```
where `d = n - m`
, `diag_index = [k] - d`
, and `index_in_diag = n - max(d, 0) + offset`
. `offset` is zero except when the alignment of the diagonal is to the right.
```
offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
and `d >= 0`) or
(`align` in {LEFT_RIGHT, RIGHT_RIGHT}
and `d <= 0`)
0 ; otherwise
```
where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`
. For example:
```
# The main diagonal.
diagonal = np.array([[1, 2, 3, 4], # Input shape: (2, 4)
[5, 6, 7, 8]])
tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0], # Output shape: (2, 4, 4)
[0, 2, 0, 0],
[0, 0, 3, 0],
[0, 0, 0, 4]],
[[5, 0, 0, 0],
[0, 6, 0, 0],
[0, 0, 7, 0],
[0, 0, 0, 8]]]
```
```
# A superdiagonal (per batch).
diagonal = np.array([[1, 2, 3], # Input shape: (2, 3)
[4, 5, 6]])
tf.matrix_diag(diagonal, k = 1)
==> [[[0, 1, 0, 0], # Output shape: (2, 4, 4)
[0, 0, 2, 0],
[0, 0, 0, 3],
[0, 0, 0, 0]],
[[0, 4, 0, 0],
[0, 0, 5, 0],
[0, 0, 0, 6],
[0, 0, 0, 0]]]
```
```
# A tridiagonal band (per batch).
diagonals = np.array([[[0, 8, 9], # Input shape: (2, 2, 3)
[1, 2, 3],
[4, 5, 0]],
[[0, 2, 3],
[6, 7, 9],
[9, 1, 0]]])
tf.matrix_diag(diagonals, k = (-1, 1))
==> [[[1, 8, 0], # Output shape: (2, 3, 3)
[4, 2, 9],
[0, 5, 3]],
[[6, 2, 0],
[9, 7, 3],
[0, 1, 9]]]
```
```
# LEFT_RIGHT alignment.
diagonals = np.array([[[8, 9, 0], # Input shape: (2, 2, 3)
[1, 2, 3],
[0, 4, 5]],
[[2, 3, 0],
[6, 7, 9],
[0, 9, 1]]])
tf.matrix_diag(diagonals, k = (-1, 1), align="LEFT_RIGHT")
==> [[[1, 8, 0], # Output shape: (2, 3, 3)
[4, 2, 9],
[0, 5, 3]],
[[6, 2, 0],
[9, 7, 3],
[0, 1, 9]]]
```
```
# Rectangular matrix.
diagonal = np.array([1, 2]) # Input shape: (2)
tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
==> [[0, 0, 0, 0], # Output shape: (3, 4)
[1, 0, 0, 0],
[0, 2, 0, 0]]
```
```
# Rectangular matrix with inferred num_cols and padding_value = 9.
tf.matrix_diag(diagonal, k = -1, num_rows = 3, padding_value = 9)
==> [[9, 9], # Output shape: (3, 2)
[1, 9],
[9, 2]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* diagonal: Rank `r`, where `r >= 1`
* k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. `k[0]` must not be larger than `k[1]`.
* num\_rows: The number of rows of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of `diagonal`.
* num\_cols: The number of columns of the output matrix. If it is not provided, the op assumes the output matrix is a square matrix and infers the matrix size from k and the innermost dimension of `diagonal`.
* padding\_value: The number to fill the area outside the specified diagonal band with. Default is 0.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/matrix-diag-v3/attrs#structtensorflow_1_1ops_1_1_matrix_diag_v3_1_1_attrs)`):
* align: Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT\_LEFT" (default), "LEFT\_RIGHT", "LEFT\_LEFT", and "RIGHT\_RIGHT". "RIGHT\_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT\_RIGHT", which is the opposite alignment.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has rank `r+1` when `k` is an integer or `k[0] == k[1]`, rank `r` otherwise.
| Constructors and Destructors |
| --- |
| `[MatrixDiagV3](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1ae15f2ceb99ae691a2f9b52311ceb67ee)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_rows, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_cols, ::[tensorflow::Input](../input#classtensorflow_1_1_input) padding_value)` |
| `[MatrixDiagV3](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1ac8140fdd73a0274d929e97471a92bcf6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_rows, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_cols, ::[tensorflow::Input](../input#classtensorflow_1_1_input) padding_value, const [MatrixDiagV3::Attrs](../../../struct/tensorflow/ops/matrix-diag-v3/attrs#structtensorflow_1_1ops_1_1_matrix_diag_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1a8470b34b4891814a4ba0fee33124c406)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1a5909ed23456448d4060a36f3efa969d1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1ad867e695b350f6aabb4d7fded813638f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1a62f98c657022427d95dd0420bcacd6f9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1a7ffe2ed277a437e26729efef42f58e0a)() const` | |
| Public static functions |
| --- |
| `[Align](#classtensorflow_1_1ops_1_1_matrix_diag_v3_1abd0ab9e473db3bcb437524898b0232d6)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/matrix-diag-v3/attrs#structtensorflow_1_1ops_1_1_matrix_diag_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MatrixDiagV3::Attrs](../../../struct/tensorflow/ops/matrix-diag-v3/attrs) | Optional attribute setters for [MatrixDiagV3](matrix-diag-v3#classtensorflow_1_1ops_1_1_matrix_diag_v3). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MatrixDiagV3
```
MatrixDiagV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input diagonal,
::tensorflow::Input k,
::tensorflow::Input num_rows,
::tensorflow::Input num_cols,
::tensorflow::Input padding_value
)
```
### MatrixDiagV3
```
MatrixDiagV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input diagonal,
::tensorflow::Input k,
::tensorflow::Input num_rows,
::tensorflow::Input num_cols,
::tensorflow::Input padding_value,
const MatrixDiagV3::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Align
```
Attrs Align(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Greater tensorflow::ops::Greater
========================
`#include <math_ops.h>`
Returns the truth value of (x > y) element-wise.
Summary
-------
*NOTE*: `[Greater](greater#classtensorflow_1_1ops_1_1_greater)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Example:
```
x = tf.constant([5, 4, 6])
y = tf.constant([5, 2, 5])
tf.math.greater(x, y) ==> [False, True, True]
```
```
x = tf.constant([5, 4, 6])
y = tf.constant([5])
tf.math.greater(x, y) ==> [False, False, True]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Greater](#classtensorflow_1_1ops_1_1_greater_1a2aae49704bca4942f8179b056f3ded68)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_greater_1a0c363bd5728eda88313f358906f92f38)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_greater_1af25048cba36e4b6413b3e1d065c31722)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_greater_1ad3f5b206140ec3379eaf5756edb7f8b1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_greater_1a8926842ea4a0a858f7a2d0387467e378)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_greater_1a7244665b7c2d5054ca8f148d2261606f)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Greater
```
Greater(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ScatterNdUpdate tensorflow::ops::ScatterNdUpdate
================================
`#include <state_ops.h>`
Applies sparse `updates` to individual values or slices within a given.
Summary
-------
variable according to `indices`.
`ref` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with rank `P` and `indices` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`. It must be shape \([d\_0, ..., d\_{Q-2}, K]\) where `0 < K <= P`.
The innermost dimension of `indices` (with length `K`) corresponds to indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th dimension of `ref`.
`updates` is `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q-1+P-K` with shape:
$$[d\_0, ..., d\_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$
For example, say we want to update 4 scattered elements to a rank-1 tensor to 8 elements. In Python, that update would look like this:
```
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
indices = tf.constant([[4], [3], [1] ,[7]])
updates = tf.constant([9, 10, 11, 12])
update = tf.scatter_nd_update(ref, indices, updates)
with tf.Session() as sess:
print sess.run(update)
```
The resulting update to ref would look like this:
```
[1, 11, 3, 10, 9, 6, 7, 12]
```
See `tf.scatter_nd` for more details about how to make updates to slices.
See also `tf.scatter_update` and `tf.batch_scatter_update`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A mutable [Tensor](../tensor#classtensorflow_1_1_tensor). Should be from a [Variable](variable#classtensorflow_1_1ops_1_1_variable) node.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of updated values to add to ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-nd-update/attrs#structtensorflow_1_1ops_1_1_scatter_nd_update_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as ref. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterNdUpdate](#classtensorflow_1_1ops_1_1_scatter_nd_update_1acb6b3b44045199decc158f661ed16c3f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterNdUpdate](#classtensorflow_1_1ops_1_1_scatter_nd_update_1ae3aa0b51b9e1787da8db1bf0b0eff7a2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterNdUpdate::Attrs](../../../struct/tensorflow/ops/scatter-nd-update/attrs#structtensorflow_1_1ops_1_1_scatter_nd_update_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_nd_update_1a8d113d05ce297b3fbdfe5ec0108a9d2a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_nd_update_1a3207186292f8bca8cf869bc6a6aa2f82)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_nd_update_1aa755e0d558f6d9154ad504413b815c87)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_nd_update_1aaf1431785e8afb4ad1f0498144a12e6b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_nd_update_1a2e39eab6b05cd85493c30752a36ca1ea)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_nd_update_1aecb251dcdebad69c21d53f5980d0dd80)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-nd-update/attrs#structtensorflow_1_1ops_1_1_scatter_nd_update_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterNdUpdate::Attrs](../../../struct/tensorflow/ops/scatter-nd-update/attrs) | Optional attribute setters for [ScatterNdUpdate](scatter-nd-update#classtensorflow_1_1ops_1_1_scatter_nd_update). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterNdUpdate
```
ScatterNdUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterNdUpdate
```
ScatterNdUpdate(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterNdUpdate::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseApplyFtrl tensorflow::ops::SparseApplyFtrl
================================
`#include <training_ops.h>`
Update relevant entries in '\*var' according to the Ftrl-proximal scheme.
Summary
-------
That is for rows we have grad for, we update var, accum and linear as follows: $$accum\_new = accum + grad \* grad$$ $$linear += grad + (accum\_{new}^{-lr\_{power} } - accum^{-lr\_{power} } / lr \* var$$ $$quadratic = 1.0 / (accum\_{new}^{lr\_{power} } \* lr) + 2 \* l2$$ $$var = (sign(linear) \* l1 - linear) / quadratic\ if\ |linear| > l1\ else\ 0.0$$ $$accum = accum\_{new}$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyFtrl](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1acfbd35749a971ae408ba24c0bb56facd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[SparseApplyFtrl](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1ae80720b9dac0b6801255f556bd27e249)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [SparseApplyFtrl::Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1ac97a954bbe52219dcd24e48de02f37e2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1aade91702a26588081047940b922727e9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1acd3ec55f3b5d70e30f21395166e3c638)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1afa8bb71a8583497722ad2240f94c157f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1a5964fb493100ead822e39ca5e2ed2710)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1acef8fb56b82d9db9afc13e42ff82e9aa)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_1aa19ce04694959f2590e9a0286d0ff8b9)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyFtrl::Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl/attrs) | Optional attribute setters for [SparseApplyFtrl](sparse-apply-ftrl#classtensorflow_1_1ops_1_1_sparse_apply_ftrl). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyFtrl
```
SparseApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power
)
```
### SparseApplyFtrl
```
SparseApplyFtrl(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input lr_power,
const SparseApplyFtrl::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Xlog1py tensorflow::ops::Xlog1py
========================
`#include <math_ops.h>`
Returns 0 if x == 0, and x \* log1p(y) otherwise, elementwise.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Xlog1py](#classtensorflow_1_1ops_1_1_xlog1py_1ab9c1499759572a8a0637d8d85ab7cc78)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_xlog1py_1a0cd1c599a14f3c2d420a706010b40595)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_xlog1py_1a2b7ee426a876810ad7f1b6f45f4ecf2a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_xlog1py_1a7a44f0bb33bfc83bf7d30b33c62ee06c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_xlog1py_1a199cda04661c8e7059a1d283f5430987)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_xlog1py_1a4c1b565eca0ed1045d9167562693e4f7)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Xlog1py
```
Xlog1py(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SquaredDifference tensorflow::ops::SquaredDifference
==================================
`#include <math_ops.h>`
Returns conj(x - y)(x - y) element-wise.
Summary
-------
*NOTE*: `[SquaredDifference](squared-difference#classtensorflow_1_1ops_1_1_squared_difference)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[SquaredDifference](#classtensorflow_1_1ops_1_1_squared_difference_1ad9d8ca7f0e712b91798188614089ba5d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_squared_difference_1af4c11704d597547182b14602f27baadd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_squared_difference_1a2aa31c19124f8b5cdaa03fccaecea978)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_squared_difference_1afea483b6c4697286b5c9f06f3526a57c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_squared_difference_1afcf4fc760c4829e3f419ca0d4da75c65)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_squared_difference_1a27a54d1e2e6c6bf753bb145ef2d6d65e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### SquaredDifference
```
SquaredDifference(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StringToNumber tensorflow::ops::StringToNumber
===============================
`#include <parsing_ops.h>`
Converts each string in the input [Tensor](../tensor#classtensorflow_1_1_tensor) to the specified numeric type.
Summary
-------
(Note that int32 overflow results in an error while float overflow results in a rounded value.)
Example:
strings = ["5.0", "3.0", "7.0"] tf.strings.to\_number(strings)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-to-number/attrs#structtensorflow_1_1ops_1_1_string_to_number_1_1_attrs)`):
* out\_type: The numeric type to interpret each string in `string_tensor` as.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) of the same shape as the input `string_tensor`.
| Constructors and Destructors |
| --- |
| `[StringToNumber](#classtensorflow_1_1ops_1_1_string_to_number_1a2cbec910739c11e321ee4cfadb7f51cd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) string_tensor)` |
| `[StringToNumber](#classtensorflow_1_1ops_1_1_string_to_number_1a0252acab04f20e08e9957ca2432b50a0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) string_tensor, const [StringToNumber::Attrs](../../../struct/tensorflow/ops/string-to-number/attrs#structtensorflow_1_1ops_1_1_string_to_number_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_to_number_1afa5b0d241901e602f299f6376ae2b920)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_to_number_1abcdb6c1c6a75a86b14e3e5140aa189dc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_to_number_1a2c7b7ca41786ef9db141011af299bd58)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_to_number_1aa213b1fd9b51537e988a8be92365a046)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_to_number_1a604062b137206642d7711040b93fa686)() const` | |
| Public static functions |
| --- |
| `[OutType](#classtensorflow_1_1ops_1_1_string_to_number_1a09ee4921abb9371c2b3a4ac3c8171403)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/string-to-number/attrs#structtensorflow_1_1ops_1_1_string_to_number_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringToNumber::Attrs](../../../struct/tensorflow/ops/string-to-number/attrs) | Optional attribute setters for [StringToNumber](string-to-number#classtensorflow_1_1ops_1_1_string_to_number). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringToNumber
```
StringToNumber(
const ::tensorflow::Scope & scope,
::tensorflow::Input string_tensor
)
```
### StringToNumber
```
StringToNumber(
const ::tensorflow::Scope & scope,
::tensorflow::Input string_tensor,
const StringToNumber::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### OutType
```
Attrs OutType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::QuantizedMul tensorflow::ops::QuantizedMul
=============================
`#include <math_ops.h>`
Returns x \* y element-wise, working on quantized buffers.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_x: The float value that the lowest quantized `x` value represents.
* max\_x: The float value that the highest quantized `x` value represents.
* min\_y: The float value that the lowest quantized `y` value represents.
* max\_y: The float value that the highest quantized `y` value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` z
* `[Output](../output#classtensorflow_1_1_output)` min\_z: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_z: The float value that the highest quantized output value represents.
*NOTE*: `[QuantizedMul](quantized-mul#classtensorflow_1_1ops_1_1_quantized_mul)` supports limited forms of broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
| Constructors and Destructors |
| --- |
| `[QuantizedMul](#classtensorflow_1_1ops_1_1_quantized_mul_1a3ba8e6004d636153b34120d1c3941667)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_y)` |
| `[QuantizedMul](#classtensorflow_1_1ops_1_1_quantized_mul_1aa33fe92400d9e03bdf4cf2ae9d212006)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_y, const [QuantizedMul::Attrs](../../../struct/tensorflow/ops/quantized-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mul_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[max\_z](#classtensorflow_1_1ops_1_1_quantized_mul_1a5ff7dd8084555c1a85768b5c4ba9704a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_z](#classtensorflow_1_1ops_1_1_quantized_mul_1afa5b6bf4063d76339c00b804ae843ea4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_mul_1ab0c6bd533e83faf6b05fde3f340b0e5f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_quantized_mul_1ab1a8cf9a36910fbb171aeb6925e47d93)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Toutput](#classtensorflow_1_1ops_1_1_quantized_mul_1a1c9da9e324d218df917b74a11a3af452)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-mul/attrs#structtensorflow_1_1ops_1_1_quantized_mul_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedMul::Attrs](../../../struct/tensorflow/ops/quantized-mul/attrs) | Optional attribute setters for [QuantizedMul](quantized-mul#classtensorflow_1_1ops_1_1_quantized_mul). |
Public attributes
-----------------
### max\_z
```
::tensorflow::Output max_z
```
### min\_z
```
::tensorflow::Output min_z
```
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### QuantizedMul
```
QuantizedMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
::tensorflow::Input min_x,
::tensorflow::Input max_x,
::tensorflow::Input min_y,
::tensorflow::Input max_y
)
```
### QuantizedMul
```
QuantizedMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
::tensorflow::Input min_x,
::tensorflow::Input max_x,
::tensorflow::Input min_y,
::tensorflow::Input max_y,
const QuantizedMul::Attrs & attrs
)
```
Public static functions
-----------------------
### Toutput
```
Attrs Toutput(
DataType x
)
```
tensorflow_cpp tensorflow::ops::TensorSummary tensorflow::ops::TensorSummary
==============================
`#include <logging_ops.h>`
Outputs a `Summary` protocol buffer with a tensor.
Summary
-------
This op is being phased out in favor of [TensorSummaryV2](tensor-summary-v2#classtensorflow_1_1ops_1_1_tensor_summary_v2), which lets callers pass a tag as well as a serialized SummaryMetadata proto string that contains plugin-specific data. We will keep this op to maintain backwards compatibility.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* tensor: A tensor to serialize.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/tensor-summary/attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)`):
* description: A json-encoded SummaryDescription proto.
* labels: An unused list of strings.
* display\_name: An unused string.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The summary tensor.
| Constructors and Destructors |
| --- |
| `[TensorSummary](#classtensorflow_1_1ops_1_1_tensor_summary_1afdb9550f4293d4ab3a2983f6edf07fbb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor)` |
| `[TensorSummary](#classtensorflow_1_1ops_1_1_tensor_summary_1ae4c43797136633dd569416f852e1bb81)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor, const [TensorSummary::Attrs](../../../struct/tensorflow/ops/tensor-summary/attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_summary_1a1d90e40e1074d7151da624b2332bc954)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[summary](#classtensorflow_1_1ops_1_1_tensor_summary_1a6b64d90ed0bed7a174d12d2057cae3d1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_summary_1aec5f002562bf25f908ea69a9ccf16148)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_summary_1a6de3fc008f2ef8aed3f658d69d7b531b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_summary_1aac762262fdb3815e85abff7635927d62)() const` | |
| Public static functions |
| --- |
| `[Description](#classtensorflow_1_1ops_1_1_tensor_summary_1af0c6bfcdd270a13450e0bed1490e9f3b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-summary/attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)` |
| `[DisplayName](#classtensorflow_1_1ops_1_1_tensor_summary_1ae0eff10fbf8400e9be9c2a2cce9d9581)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-summary/attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)` |
| `[Labels](#classtensorflow_1_1ops_1_1_tensor_summary_1a4da063086f3ea3a8b164ca31802d71a3)(const gtl::ArraySlice<::tensorflow::tstring > & x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-summary/attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TensorSummary::Attrs](../../../struct/tensorflow/ops/tensor-summary/attrs) | Optional attribute setters for [TensorSummary](tensor-summary#classtensorflow_1_1ops_1_1_tensor_summary). |
Public attributes
-----------------
### operation
```
Operation operation
```
### summary
```
::tensorflow::Output summary
```
Public functions
----------------
### TensorSummary
```
TensorSummary(
const ::tensorflow::Scope & scope,
::tensorflow::Input tensor
)
```
### TensorSummary
```
TensorSummary(
const ::tensorflow::Scope & scope,
::tensorflow::Input tensor,
const TensorSummary::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Description
```
Attrs Description(
StringPiece x
)
```
### DisplayName
```
Attrs DisplayName(
StringPiece x
)
```
### Labels
```
Attrs Labels(
const gtl::ArraySlice<::tensorflow::tstring > & x
)
```
tensorflow_cpp tensorflow::ops::ApplyAdadelta tensorflow::ops::ApplyAdadelta
==============================
`#include <training_ops.h>`
Update '\*var' according to the adadelta scheme.
Summary
-------
accum = rho() \* accum + (1 - rho()) \* grad.square(); update = (update\_accum + epsilon).sqrt() \* (accum + epsilon()).rsqrt() \* grad; update\_accum = rho() \* update\_accum + (1 - rho()) \* update.square(); var -= update;
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* accum\_update: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay factor. Must be a scalar.
* epsilon: Constant factor. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-adadelta/attrs#structtensorflow_1_1ops_1_1_apply_adadelta_1_1_attrs)`):
* use\_locking: If True, updating of the var, accum and update\_accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyAdadelta](#classtensorflow_1_1ops_1_1_apply_adadelta_1aa28344b035c47c459fd0afca95547d97)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyAdadelta](#classtensorflow_1_1ops_1_1_apply_adadelta_1a08f5d27287a3064abb5e3b83fadbe887)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyAdadelta::Attrs](../../../struct/tensorflow/ops/apply-adadelta/attrs#structtensorflow_1_1ops_1_1_apply_adadelta_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_adadelta_1a4bcd49cd72b4103e0041a1231ad7cbfb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_adadelta_1aaa46dd79340e6999dac483165b45499d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_adadelta_1a7ab3d73516eacd84efdba9d4c8bb31dd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_adadelta_1aa0992e4c234bd33403c057425829457c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_adadelta_1a0d01185e91e72c289949de8ca852c923)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_adadelta_1a8545cc26c688935679d0a732a1407986)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-adadelta/attrs#structtensorflow_1_1ops_1_1_apply_adadelta_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyAdadelta::Attrs](../../../struct/tensorflow/ops/apply-adadelta/attrs) | Optional attribute setters for [ApplyAdadelta](apply-adadelta#classtensorflow_1_1ops_1_1_apply_adadelta). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyAdadelta
```
ApplyAdadelta(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input accum_update,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ApplyAdadelta
```
ApplyAdadelta(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input accum_update,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ApplyAdadelta::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseTensorDenseAdd tensorflow::ops::SparseTensorDenseAdd
=====================================
`#include <sparse_ops.h>`
Adds up a `SparseTensor` and a dense `[Tensor](../tensor#classtensorflow_1_1_tensor)`, producing a dense `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
Summary
-------
This Op does not require `a_indices` be sorted in standard lexicographic order.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* a\_indices: 2-D. The `indices` of the `SparseTensor`, with shape `[nnz, ndims]`.
* a\_values: 1-D. The `values` of the `SparseTensor`, with shape `[nnz]`.
* a\_shape: 1-D. The `shape` of the `SparseTensor`, with shape `[ndims]`.
* b: `ndims`-D [Tensor](../tensor#classtensorflow_1_1_tensor). With shape `a_shape`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[SparseTensorDenseAdd](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_add_1a38c64871414d5de93d943d6971794d45)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_add_1a1459d5b89685305fc2681d3f306dd73b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_add_1a6978070283c292c128c808e0b999f6ee)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_add_1ac51ac5fcff835a3664c01c66cbbff941)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_add_1a7d18748b94a687fabc17564c822da90d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_tensor_dense_add_1a1b17ec100ab821b17c835af61c1eceb2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseTensorDenseAdd
```
SparseTensorDenseAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input a_indices,
::tensorflow::Input a_values,
::tensorflow::Input a_shape,
::tensorflow::Input b
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Requantize tensorflow::ops::Requantize
===========================
`#include <math_ops.h>`
Converts the quantized `input` tensor into a lower-precision `output`.
Summary
-------
Converts the quantized `input` tensor into a lower-precision `output`, using the output range specified with `requested_output_min` and `requested_output_max`.
`[input_min, input_max]` are scalar floats that specify the range for the float interpretation of the `input` data. For example, if `input_min` is -1.0f and `input_max` is 1.0f, and we are dealing with `quint16` quantized data, then a 0 value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_min: The float value that the minimum quantized input value represents.
* input\_max: The float value that the maximum quantized input value represents.
* requested\_output\_min: The float value that the minimum quantized output value represents.
* requested\_output\_max: The float value that the maximum quantized output value represents.
* out\_type: The type of the output. Should be a lower bit depth than Tinput.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output
* `[Output](../output#classtensorflow_1_1_output)` output\_min: The requested\_output\_min value is copied into this output.
* `[Output](../output#classtensorflow_1_1_output)` output\_max: The requested\_output\_max value is copied into this output.
| Constructors and Destructors |
| --- |
| `[Requantize](#classtensorflow_1_1ops_1_1_requantize_1a308b260de4bb034d5561eb8a52310abc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) requested_output_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) requested_output_max, DataType out_type)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_requantize_1a418db3e46025f9b9e36d77ff8233a408)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_requantize_1a23db07728fcff66ef701c31a42704390)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_max](#classtensorflow_1_1ops_1_1_requantize_1af6a7b4ea10c4da08919da8374402de2c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_min](#classtensorflow_1_1ops_1_1_requantize_1a4c87262c09c761de0cb078e4c2584d1e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
### output\_max
```
::tensorflow::Output output_max
```
### output\_min
```
::tensorflow::Output output_min
```
Public functions
----------------
### Requantize
```
Requantize(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max,
::tensorflow::Input requested_output_min,
::tensorflow::Input requested_output_max,
DataType out_type
)
```
tensorflow_cpp tensorflow::ops::Min tensorflow::ops::Min
====================
`#include <math_ops.h>`
Computes the minimum of elements across dimensions of a tensor.
Summary
-------
Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The tensor to reduce.
* axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/min/attrs#structtensorflow_1_1ops_1_1_min_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor.
Aliases:
* ReduceMin
| Constructors and Destructors |
| --- |
| `[Min](#classtensorflow_1_1ops_1_1_min_1aa84e18b1cad709d6513590319f928fb0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[Min](#classtensorflow_1_1ops_1_1_min_1a6bfcc4bf983c83051826e4d0a8c1df24)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Min::Attrs](../../../struct/tensorflow/ops/min/attrs#structtensorflow_1_1ops_1_1_min_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_min_1a827a914fb005e06f5dc6f7ed1eb51be4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_min_1a2cab2bdeee290d830a27f010f51659c1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_min_1ad7d4dc74f3a59d6bbe72a42bf464d0ef)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_min_1ae1836c4f4dd286309f9f528a1683264a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_min_1a5ecc266624f653708a33459a66704ee8)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_min_1a18c6f1807aac60577c43ee7fff2276e4)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/min/attrs#structtensorflow_1_1ops_1_1_min_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Min::Attrs](../../../struct/tensorflow/ops/min/attrs) | Optional attribute setters for [Min](min#classtensorflow_1_1ops_1_1_min). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Min
```
Min(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis
)
```
### Min
```
Min(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input axis,
const Min::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::StatelessSampleDistortedBoundingBox tensorflow::ops::StatelessSampleDistortedBoundingBox
====================================================
`#include <image_ops.h>`
Generate a randomly distorted bounding box for an image deterministically.
Summary
-------
Bounding box annotations are often supplied in addition to ground-truth labels in image recognition or object localization tasks. A common technique for training such a system is to randomly distort an image while preserving its content, i.e. *data augmentation*. This Op, given the same `seed`, deterministically outputs a randomly distorted localization of an object, i.e. bounding box, given an `image_size`, `bounding_boxes` and a series of constraints.
The output of this Op is a single bounding box that may be used to crop the original image. The output is returned as 3 tensors: `begin`, `size` and `bboxes`. The first 2 tensors can be fed directly into `tf.slice` to crop the image. The latter may be supplied to `tf.image.draw_bounding_boxes` to visualize what the bounding box looks like.
Bounding boxes are supplied and returned as `[y_min, x_min, y_max, x_max]`. The bounding box coordinates are floats in `[0.0, 1.0]` relative to the width and the height of the underlying image.
The output of this Op is guaranteed to be the same given the same `seed` and is independent of how many times the function is called, and independent of global seed settings (e.g. `tf.random.set_seed`).
Example usage:
image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) bbox = tf.constant( ... [0.0, 0.0, 1.0, 1.0], dtype=tf.float32, shape=[1, 1, 4]) seed = (1, 2)
Generate a single distorted bounding box.
=========================================
bbox\_begin, bbox\_size, bbox\_draw = ( ... tf.image.stateless\_sample\_distorted\_bounding\_box( ... tf.shape(image), bounding\_boxes=bbox, seed=seed)) Employ the bounding box to distort the image.
=============================================
tf.slice(image, bbox\_begin, bbox\_size) Draw the bounding box in an image summary.
==========================================
colors = np.array([[1.0, 0.0, 0.0], [0.0, 0.0, 1.0]]) tf.image.draw\_bounding\_boxes( ... tf.expand\_dims(tf.cast(image, tf.float32),0), bbox\_draw, colors) Note that if no bounding box information is available, setting `use_image_if_no_bounding_boxes = true` will assume there is a single implicit bounding box covering the whole image. If `use_image_if_no_bounding_boxes` is false and no bounding boxes are supplied, an error is raised.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* image\_size: 1-D, containing `[height, width, channels]`.
* bounding\_boxes: 3-D with shape `[batch, N, 4]` describing the N bounding boxes associated with the image.
* min\_object\_covered: The cropped area of the image must contain at least this fraction of any bounding box supplied. The value of this parameter should be non-negative. In the case of 0, the cropped area does not need to overlap any of the bounding boxes supplied.
* seed: 1-D with shape `[2]`. The seed to the random number generator. Must have dtype `int32` or `int64`. (When using XLA, only `int32` is allowed.)
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)`):
* aspect\_ratio\_range: The cropped area of the image must have an aspect ratio = width / height within this range.
* area\_range: The cropped area of the image must contain a fraction of the supplied image within this range.
* max\_attempts: Number of attempts at generating a cropped region of the image of the specified constraints. After `max_attempts` failures, return the entire image.
* use\_image\_if\_no\_bounding\_boxes: Controls behavior if no bounding boxes supplied. If true, assume an implicit bounding box covering the whole input. If false, raise an error.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` begin: 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to `tf.slice`.
* `[Output](../output#classtensorflow_1_1_output)` size: 1-D, containing `[target_height, target_width, -1]`. Provide as input to `tf.slice`.
* `[Output](../output#classtensorflow_1_1_output)` bboxes: 3-D with shape `[1, 1, 4]` containing the distorted bounding box. Provide as input to `tf.image.draw_bounding_boxes`.
| Constructors and Destructors |
| --- |
| `[StatelessSampleDistortedBoundingBox](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a8e3e1f628542596b40c7007cec751472)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bounding_boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_object_covered, ::[tensorflow::Input](../input#classtensorflow_1_1_input) seed)` |
| `[StatelessSampleDistortedBoundingBox](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a2180ee953542277f11b5ff955e5cb31c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bounding_boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_object_covered, ::[tensorflow::Input](../input#classtensorflow_1_1_input) seed, const [StatelessSampleDistortedBoundingBox::Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[bboxes](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a3e71c37eb846dfbdc0404d26d2fee2f8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[begin](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a4020c9f475fc53770dbc06d4d95cd630)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a8286320d0ef4a8425aa51026d34111db)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1ae04677923f8020c6fb3ebc6385889b3b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[AreaRange](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1aee10b7401b9d5d2d9ed30193e8bdf5ba)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` |
| `[AspectRatioRange](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a5fbb107854b3794319f7663e1f620c57)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` |
| `[MaxAttempts](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a0b5561af6e0244323c479ad610254bdf)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` |
| `[UseImageIfNoBoundingBoxes](#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1a2edc220c34de1da4ccd8f5ac0aac6f3b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs](../../../struct/tensorflow/ops/stateless-sample-distorted-bounding-box/attrs) | Optional attribute setters for [StatelessSampleDistortedBoundingBox](stateless-sample-distorted-bounding-box#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box). |
Public attributes
-----------------
### bboxes
```
::tensorflow::Output bboxes
```
### begin
```
::tensorflow::Output begin
```
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### StatelessSampleDistortedBoundingBox
```
StatelessSampleDistortedBoundingBox(
const ::tensorflow::Scope & scope,
::tensorflow::Input image_size,
::tensorflow::Input bounding_boxes,
::tensorflow::Input min_object_covered,
::tensorflow::Input seed
)
```
### StatelessSampleDistortedBoundingBox
```
StatelessSampleDistortedBoundingBox(
const ::tensorflow::Scope & scope,
::tensorflow::Input image_size,
::tensorflow::Input bounding_boxes,
::tensorflow::Input min_object_covered,
::tensorflow::Input seed,
const StatelessSampleDistortedBoundingBox::Attrs & attrs
)
```
Public static functions
-----------------------
### AreaRange
```
Attrs AreaRange(
const gtl::ArraySlice< float > & x
)
```
### AspectRatioRange
```
Attrs AspectRatioRange(
const gtl::ArraySlice< float > & x
)
```
### MaxAttempts
```
Attrs MaxAttempts(
int64 x
)
```
### UseImageIfNoBoundingBoxes
```
Attrs UseImageIfNoBoundingBoxes(
bool x
)
```
tensorflow_cpp tensorflow::ops::SaveV2 tensorflow::ops::SaveV2
=======================
`#include <io_ops.h>`
Saves tensors in V2 checkpoint format.
Summary
-------
By default, saves the named tensors in full. If the caller wishes to save specific slices of full tensors, "shape\_and\_slices" should be non-empty strings and correspondingly well-formed.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* prefix: Must have a single element. The prefix of the V2 checkpoint to which we write the tensors.
* tensor\_names: shape {N}. The names of the tensors to be saved.
* shape\_and\_slices: shape {N}. The slice specs of the tensors to be saved. [Empty](empty#classtensorflow_1_1ops_1_1_empty) strings indicate that they are non-partitioned tensors.
* tensors: `N` tensors to save.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[SaveV2](#classtensorflow_1_1ops_1_1_save_v2_1a1ffd5c412f4b1620ffbe3c2a4a8b5f56)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) prefix, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_names, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape_and_slices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) tensors)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_save_v2_1aef163a3bab67f5acd5fade77d3998b72)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_save_v2_1ae9919485ae23077f045387f5509adb41)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### SaveV2
```
SaveV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input prefix,
::tensorflow::Input tensor_names,
::tensorflow::Input shape_and_slices,
::tensorflow::InputList tensors
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ApplyAdagradDA tensorflow::ops::ApplyAdagradDA
===============================
`#include <training_ops.h>`
Update '\*var' according to the proximal adagrad scheme.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* gradient\_accumulator: Should be from a Variable().
* gradient\_squared\_accumulator: Should be from a Variable().
* grad: The gradient.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* global\_step: Training step number. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_d_a_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyAdagradDA](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1a9717622961f444da4444a7cad85c1147)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step)` |
| `[ApplyAdagradDA](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1a0176953b80b50c379313cad4ace5ee5e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step, const [ApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_d_a_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1aeb5c4fba5cf1669a64c356f8beb3f37a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1aa81832322b402afc32afca0e2663ba26)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1a6018e2f78356d28e62d64284d1da7e04)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1a6561d70fc94fe24224939f3680880f4b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1a50b9e5a00627be0d50ac540b4a762ed1)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_adagrad_d_a_1afef1833b1630afd75a5b5c41a39b2ed1)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_d_a_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/apply-adagrad-d-a/attrs) | Optional attribute setters for [ApplyAdagradDA](apply-adagrad-d-a#classtensorflow_1_1ops_1_1_apply_adagrad_d_a). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyAdagradDA
```
ApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step
)
```
### ApplyAdagradDA
```
ApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step,
const ApplyAdagradDA::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::StringJoin tensorflow::ops::StringJoin
===========================
`#include <string_ops.h>`
Joins the strings in the given list of string tensors into one tensor;.
Summary
-------
with the given separator (default is an empty separator).
Examples:
s = ["hello", "world", "tensorflow"] tf.strings.join(s, " ")
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* inputs: A list of string tensors. The tensors must all have the same shape, or be scalars. Scalars may be mixed in; these will be broadcast to the shape of non-scalar inputs.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-join/attrs#structtensorflow_1_1ops_1_1_string_join_1_1_attrs)`):
* separator: string, an optional join separator.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[StringJoin](#classtensorflow_1_1ops_1_1_string_join_1a15c57f33fd4f7b08d95bf8cb9c05f0c9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs)` |
| `[StringJoin](#classtensorflow_1_1ops_1_1_string_join_1a43b051d46111b51b8b5d036b7aa003ad)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs, const [StringJoin::Attrs](../../../struct/tensorflow/ops/string-join/attrs#structtensorflow_1_1ops_1_1_string_join_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_join_1aa505e860621ab8ebe74b66cb2237d671)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_join_1ad7d4e015e3580cc089259af4c8de6a98)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_join_1a0e2875fbda42c85d6a67178b0167d873)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_join_1ac55b4cd4d63e5a3952e20cd5f02ae27c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_join_1a7c4a6cddda218bf07e100623c0c7ae32)() const` | |
| Public static functions |
| --- |
| `[Separator](#classtensorflow_1_1ops_1_1_string_join_1a40a9c12772d32dd2fd3c40779dce2198)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/string-join/attrs#structtensorflow_1_1ops_1_1_string_join_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringJoin::Attrs](../../../struct/tensorflow/ops/string-join/attrs) | Optional attribute setters for [StringJoin](string-join#classtensorflow_1_1ops_1_1_string_join). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringJoin
```
StringJoin(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs
)
```
### StringJoin
```
StringJoin(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs,
const StringJoin::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Separator
```
Attrs Separator(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Gather tensorflow::ops::Gather
=======================
`#include <array_ops.h>`
[Gather](gather#classtensorflow_1_1ops_1_1_gather) slices from `params` according to `indices`.
Summary
-------
`indices` must be an integer tensor of any dimension (usually 0-D or 1-D). Produces an output tensor with shape `indices.shape + params.shape[1:]` where:
```
# Scalar indices
output[:, ..., :] = params[indices, :, ... :]
```
```
# Vector indices
output[i, :, ..., :] = params[indices[i], :, ... :]
```
```
# Higher rank indices
output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
```
If `indices` is a permutation and `len(indices) == params.shape[0]` then this operation will permute `params` accordingly.
`validate_indices`: DEPRECATED. If this operation is assigned to CPU, values in `indices` are always validated to be within range. If assigned to GPU, out-of-bound indices result in safe but unspecified behavior, which may include raising an error.

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Gather](#classtensorflow_1_1ops_1_1_gather_1a839275b14b2a970a2bdaafee039469dd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) params, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[Gather](#classtensorflow_1_1ops_1_1_gather_1aafacd8f95dd561da28cb61d32a6a315f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) params, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [Gather::Attrs](../../../struct/tensorflow/ops/gather/attrs#structtensorflow_1_1ops_1_1_gather_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_gather_1a324a25a3a94bb8ec9ea1f0c18e864f7d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_gather_1a9d78b5b304387efee0e53b5afaa384ef)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_gather_1a6861dab37fe274f230029422bd94b724)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_gather_1a8ea808391c4824b35409a4427fcfd5eb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_gather_1a3dfd72e34f22afeaad6918d75a6cfdcd)() const` | |
| Public static functions |
| --- |
| `[ValidateIndices](#classtensorflow_1_1ops_1_1_gather_1acb10767dcd5da7c1d454b97feafe2f3b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/gather/attrs#structtensorflow_1_1ops_1_1_gather_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Gather::Attrs](../../../struct/tensorflow/ops/gather/attrs) | Optional attribute setters for [Gather](gather#classtensorflow_1_1ops_1_1_gather). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Gather
```
Gather(
const ::tensorflow::Scope & scope,
::tensorflow::Input params,
::tensorflow::Input indices
)
```
### Gather
```
Gather(
const ::tensorflow::Scope & scope,
::tensorflow::Input params,
::tensorflow::Input indices,
const Gather::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### ValidateIndices
```
Attrs ValidateIndices(
bool x
)
```
tensorflow_cpp tensorflow::ops::Multinomial tensorflow::ops::Multinomial
============================
`#include <random_ops.h>`
Draws samples from a multinomial distribution.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* logits: 2-D [Tensor](../tensor#classtensorflow_1_1_tensor) with shape `[batch_size, num_classes]`. Each slice `[i, :]` represents the unnormalized log probabilities for all classes.
* num\_samples: 0-D. Number of independent samples to draw for each row slice.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/multinomial/attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)`):
* seed: If either seed or seed2 is set to be non-zero, the internal random number generator is seeded by the given seed. Otherwise, a random seed is used.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 2-D [Tensor](../tensor#classtensorflow_1_1_tensor) with shape `[batch_size, num_samples]`. Each slice `[i, :]` contains the drawn class labels with range `[0, num_classes)`.
| Constructors and Destructors |
| --- |
| `[Multinomial](#classtensorflow_1_1ops_1_1_multinomial_1a96d252cc42db1e0cad0a64cb36e8dd17)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logits, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_samples)` |
| `[Multinomial](#classtensorflow_1_1ops_1_1_multinomial_1a70c0ba099add2db08773240f75d985e3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logits, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_samples, const [Multinomial::Attrs](../../../struct/tensorflow/ops/multinomial/attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_multinomial_1a45b39de08c317c75ef554114ab7305f2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_multinomial_1a6a1eb6aa0ee5680c889a15fcbb64eea1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_multinomial_1ae386d54422fe11f8963cdb5c403c4dd5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_multinomial_1ab7c86d59414a2504b91b5e9f6a34e7b9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_multinomial_1a2c35c8fd690941576d7163b605d01678)() const` | |
| Public static functions |
| --- |
| `[OutputDtype](#classtensorflow_1_1ops_1_1_multinomial_1a52a67bb622d9dc2c672d5b534e498335)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/multinomial/attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_multinomial_1a5fba481081090883283e3b7e556565ee)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/multinomial/attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_multinomial_1ae46c069e65181a29054c3f64ac06d630)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/multinomial/attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Multinomial::Attrs](../../../struct/tensorflow/ops/multinomial/attrs) | Optional attribute setters for [Multinomial](multinomial#classtensorflow_1_1ops_1_1_multinomial). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Multinomial
```
Multinomial(
const ::tensorflow::Scope & scope,
::tensorflow::Input logits,
::tensorflow::Input num_samples
)
```
### Multinomial
```
Multinomial(
const ::tensorflow::Scope & scope,
::tensorflow::Input logits,
::tensorflow::Input num_samples,
const Multinomial::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### OutputDtype
```
Attrs OutputDtype(
DataType x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::Log tensorflow::ops::Log
====================
`#include <math_ops.h>`
Computes natural logarithm of x element-wise.
Summary
-------
I.e., \(y = \log\_e x\).
Example:
```
x = tf.constant([0, 0.5, 1, 5])
tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Log](#classtensorflow_1_1ops_1_1_log_1a145fe420ff76b59789b7835937d0ca92)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_log_1a00151d936de692cd5e52c1294a487f01)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_log_1aa990c81216307d8f11eec2182706812a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_log_1a8713e28e8ee194c17f69961f78a81dcf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_log_1a08a25bef40eae77563101d5d4b74c90e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_log_1a97221223cc46aad13ee46dfdc25c82f6)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Log
```
Log(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StringLower tensorflow::ops::StringLower
============================
`#include <string_ops.h>`
Converts all uppercase characters into their respective lowercase replacements.
Summary
-------
Example:
tf.strings.lower("CamelCase string and ALL CAPS")
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The input to be lower-cased.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-lower/attrs#structtensorflow_1_1ops_1_1_string_lower_1_1_attrs)`):
* encoding: Character encoding of `input`. Allowed values are '' and 'utf-8'. Value '' is interpreted as ASCII.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[StringLower](#classtensorflow_1_1ops_1_1_string_lower_1aa2828af9a9b16fd37cf03ce746c60c2e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[StringLower](#classtensorflow_1_1ops_1_1_string_lower_1a4f937845d6268a799fd294ee24322ae4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [StringLower::Attrs](../../../struct/tensorflow/ops/string-lower/attrs#structtensorflow_1_1ops_1_1_string_lower_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_lower_1a258ba3f94f899a4798d678559d700bef)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_lower_1a6fffab5174d79194de0807bc1b9de98e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_lower_1a06590aeb47baedabff0cbcce763770f5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_lower_1a459cc819a4457c68bf5ada4e2f61952d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_lower_1ae0bdf20b2faaec504eb60da11f3f0bef)() const` | |
| Public static functions |
| --- |
| `[Encoding](#classtensorflow_1_1ops_1_1_string_lower_1a734cccb6e59581e6a96e238592ab8660)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/string-lower/attrs#structtensorflow_1_1ops_1_1_string_lower_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringLower::Attrs](../../../struct/tensorflow/ops/string-lower/attrs) | Optional attribute setters for [StringLower](string-lower#classtensorflow_1_1ops_1_1_string_lower). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringLower
```
StringLower(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### StringLower
```
StringLower(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const StringLower::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Encoding
```
Attrs Encoding(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Expm1 tensorflow::ops::Expm1
======================
`#include <math_ops.h>`
Computes `exp(x) - 1` element-wise.
Summary
-------
i.e. `exp(x) - 1` or `e^(x) - 1`, where `x` is the input tensor. `e` denotes Euler's number and is approximately equal to 2.718281.
```
x = tf.constant(2.0)
tf.math.expm1(x) ==> 6.389056
```
```
x = tf.constant([2.0, 8.0])
tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)
```
```
x = tf.constant(1 + 1j)
tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Expm1](#classtensorflow_1_1ops_1_1_expm1_1a8b296111e0b616c52bb1ac32c54a6d7a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_expm1_1a7a9850515f4ea6fbf373787463eb09df)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_expm1_1a05fbc6afc7aea30c2af304ea0f47dbf4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_expm1_1a8f37d6ec3ccfb35f8989f12b006ef8f3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_expm1_1a9ea90c07657a9520b10ba34cf017fe7a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_expm1_1a0adfeeb72d4fe4c11e5d03a6fd39facc)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Expm1
```
Expm1(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizedRelu6 tensorflow::ops::QuantizedRelu6
===============================
`#include <nn_ops.h>`
Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)`
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_features: The float value that the lowest quantized value represents.
* max\_features: The float value that the highest quantized value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` activations: Has the same output shape as "features".
* `[Output](../output#classtensorflow_1_1_output)` min\_activations: The float value that the lowest quantized value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_activations: The float value that the highest quantized value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedRelu6](#classtensorflow_1_1ops_1_1_quantized_relu6_1a878166661980db1eef4b8c9d50fc30bd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_features)` |
| `[QuantizedRelu6](#classtensorflow_1_1ops_1_1_quantized_relu6_1a0b98f095d6d5b347b4c2dcc3a01e8ec2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_features, const [QuantizedRelu6::Attrs](../../../struct/tensorflow/ops/quantized-relu6/attrs#structtensorflow_1_1ops_1_1_quantized_relu6_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_quantized_relu6_1a0195a63b71b99cf501ef199e1268ff86)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[max\_activations](#classtensorflow_1_1ops_1_1_quantized_relu6_1a6f102937d57571fa7694537be05d453b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_activations](#classtensorflow_1_1ops_1_1_quantized_relu6_1a7f0565bd18f8a108c1bddef3b8fc547b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_relu6_1a90c72f4f64dfe25a7764d19e04acda03)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[OutType](#classtensorflow_1_1ops_1_1_quantized_relu6_1af73914317d242138de7fb5ac4d3faaa1)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-relu6/attrs#structtensorflow_1_1ops_1_1_quantized_relu6_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedRelu6::Attrs](../../../struct/tensorflow/ops/quantized-relu6/attrs) | Optional attribute setters for [QuantizedRelu6](quantized-relu6#classtensorflow_1_1ops_1_1_quantized_relu6). |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### max\_activations
```
::tensorflow::Output max_activations
```
### min\_activations
```
::tensorflow::Output min_activations
```
### operation
```
Operation operation
```
Public functions
----------------
### QuantizedRelu6
```
QuantizedRelu6(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input min_features,
::tensorflow::Input max_features
)
```
### QuantizedRelu6
```
QuantizedRelu6(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input min_features,
::tensorflow::Input max_features,
const QuantizedRelu6::Attrs & attrs
)
```
Public static functions
-----------------------
### OutType
```
Attrs OutType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::Cumsum tensorflow::ops::Cumsum
=======================
`#include <math_ops.h>`
Compute the cumulative sum of the tensor `x` along `axis`.
Summary
-------
By default, this op performs an inclusive cumsum, which means that the first element of the input is identical to the first element of the output:
```
tf.cumsum([a, b, c]) # => [a, a + b, a + b + c]
```
By setting the `exclusive` kwarg to `True`, an exclusive cumsum is performed instead:
```
tf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]
```
By setting the `reverse` kwarg to `True`, the cumsum is performed in the opposite direction:
```
tf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]
```
This is more efficient than using separate `tf.reverse` ops.
The `reverse` and `exclusive` kwargs can also be combined:
```
tf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A `[Tensor](../tensor#classtensorflow_1_1_tensor)`. Must be one of the following types: `float32`, `float64`, `int64`, `int32`, `uint8`, `uint16`, `int16`, `int8`, `complex64`, `complex128`, `qint8`, `quint8`, `qint32`, `half`.
* axis: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `int32` (default: 0). Must be in the range `[-rank(x), rank(x))`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/cumsum/attrs#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs)`):
* exclusive: If `True`, perform exclusive cumsum.
* reverse: A `bool` (default: False).
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The out tensor.
| Constructors and Destructors |
| --- |
| `[Cumsum](#classtensorflow_1_1ops_1_1_cumsum_1ac4bff34c1fffc1a64355bd97e38887d2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[Cumsum](#classtensorflow_1_1ops_1_1_cumsum_1afe84204de0e7a885385374174240fcc3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Cumsum::Attrs](../../../struct/tensorflow/ops/cumsum/attrs#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_cumsum_1abe2a855b0b89aedaadef5b1ab2d495f6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_cumsum_1aa1249678696c8bec40fc3737ff3af4b0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_cumsum_1a638d380af05abb4f7dbdafb4d578e5c4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cumsum_1a433ea12bc76c446dca36009246b62bb4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cumsum_1a273a98f7b496769e405300dc1b76addd)() const` | |
| Public static functions |
| --- |
| `[Exclusive](#classtensorflow_1_1ops_1_1_cumsum_1a405094be636726578ca6715ceeb29637)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/cumsum/attrs#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs)` |
| `[Reverse](#classtensorflow_1_1ops_1_1_cumsum_1affad4b03f430a883b021c21fafd4ddbf)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/cumsum/attrs#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Cumsum::Attrs](../../../struct/tensorflow/ops/cumsum/attrs) | Optional attribute setters for [Cumsum](cumsum#classtensorflow_1_1ops_1_1_cumsum). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### Cumsum
```
Cumsum(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input axis
)
```
### Cumsum
```
Cumsum(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input axis,
const Cumsum::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Exclusive
```
Attrs Exclusive(
bool x
)
```
### Reverse
```
Attrs Reverse(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseDenseCwiseMul tensorflow::ops::SparseDenseCwiseMul
====================================
`#include <sparse_ops.h>`
Component-wise multiplies a SparseTensor by a dense [Tensor](../tensor#classtensorflow_1_1_tensor).
Summary
-------
The output locations corresponding to the implicitly zero elements in the sparse tensor will be zero (i.e., will not take up storage space), regardless of the contents of the dense tensor (even if it's +/-INF and that INF\*0 == NaN).
*Limitation*: this Op only broadcasts the dense side to the sparse side, but not the other direction.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sp\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* sp\_values: 1-D. `N` non-empty values corresponding to `sp_indices`.
* sp\_shape: 1-D. Shape of the input SparseTensor.
* dense: `R`-D. The dense [Tensor](../tensor#classtensorflow_1_1_tensor) operand.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D. The `N` values that are operated on.
| Constructors and Destructors |
| --- |
| `[SparseDenseCwiseMul](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_mul_1a884270b76fd3fbf6b5db27dbb284b825)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_mul_1a1cbb106ceb29f4d80fa5618ac7a0391f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_mul_1a90d4c55f83816dd179b83fb561a3d14a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_mul_1a129f0f5944cd5528658cb2fe913a8e88)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_mul_1af40c98d474b6d10da285068a5865bbcb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_mul_1a820cf17bf53dea855ae65c6afa1bf5e8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseDenseCwiseMul
```
SparseDenseCwiseMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input sp_indices,
::tensorflow::Input sp_values,
::tensorflow::Input sp_shape,
::tensorflow::Input dense
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StageSize tensorflow::ops::StageSize
==========================
`#include <data_flow_ops.h>`
Op returns the number of elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The size tensor.
| Constructors and Destructors |
| --- |
| `[StageSize](#classtensorflow_1_1ops_1_1_stage_size_1ad6c35b6a0cb2dab3b4f64d22c9696246)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[StageSize](#classtensorflow_1_1ops_1_1_stage_size_1af4cd4e2702b0d7d8866c84cda31c589b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [StageSize::Attrs](../../../struct/tensorflow/ops/stage-size/attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_stage_size_1a05e6be509ebaa7bbd4a0366753154a07)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_stage_size_1a8bb24c053d1097c5d415a1a4417ab9c8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_stage_size_1a23fc51c9035b1c88f64829c142419b9c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_stage_size_1a1c8a190dfa808b5df570579e5129451d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_stage_size_1ac0fbb0f4546715a5853f21cc6d60dc23)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_stage_size_1a974ff9ae22d95a7c48f2f44fcdac8b61)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage-size/attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_stage_size_1a130a5ec2a7a09c98d381b601858a782f)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage-size/attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_stage_size_1a38dd8772795cd97df0513e3855447b43)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stage-size/attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_stage_size_1a836135ddd4196e9b82288ab1775ab515)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/stage-size/attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StageSize::Attrs](../../../struct/tensorflow/ops/stage-size/attrs) | Optional attribute setters for [StageSize](stage-size#classtensorflow_1_1ops_1_1_stage_size). |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### StageSize
```
StageSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### StageSize
```
StageSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const StageSize::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::FractionalMaxPool tensorflow::ops::FractionalMaxPool
==================================
`#include <nn_ops.h>`
Performs fractional max pooling on the input.
Summary
-------
Fractional max pooling is slightly different than regular max pooling. In regular max pooling, you downsize an input set by taking the maximum value of smaller N x N subsections of the set (often 2x2), and try to reduce the set by a factor of N, where N is an integer. Fractional max pooling, as you might expect from the word "fractional", means that the overall reduction ratio N does not have to be an integer.
The sizes of the pooling regions are generated randomly but are fairly uniform. For example, let's look at the height dimension, and the constraints on the list of rows that will be pool boundaries.
First we define the following:
1. input\_row\_length : the number of rows from the input set
2. output\_row\_length : which will be smaller than the input
3. alpha = input\_row\_length / output\_row\_length : our reduction ratio
4. K = floor(alpha)
5. row\_pooling\_sequence : this is the result list of pool boundary rows
Then, row\_pooling\_sequence should satisfy:
1. a[0] = 0 : the first value of the sequence is 0
2. a[end] = input\_row\_length : the last value of the sequence is the size
3. K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
4. length(row\_pooling\_sequence) = output\_row\_length+1
For more details on fractional max pooling, see this paper: [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* value: 4-D with shape `[batch, height, width, channels]`.
* pooling\_ratio: Pooling ratio for each dimension of `value`, currently only supports row and col dimension and should be >= 1.0. For example, a valid pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements must be 1.0 because we don't allow pooling on batch and channels dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions respectively.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)`):
* pseudo\_random: When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for difference between pseudorandom and random.
* overlapping: When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example:
`index 0 1 2 3 4`
`value 20 5 16 3 7`
If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional max pooling.
* deterministic: When set to True, a fixed pooling region will be used when iterating over a [FractionalMaxPool](fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool) node in the computation graph. Mainly used in unit test to make [FractionalMaxPool](fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool) deterministic.
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output: output tensor after fractional max pooling.
* `[Output](../output#classtensorflow_1_1_output)` row\_pooling\_sequence: row pooling sequence, needed to calculate gradient.
* `[Output](../output#classtensorflow_1_1_output)` col\_pooling\_sequence: column pooling sequence, needed to calculate gradient.
| Constructors and Destructors |
| --- |
| `[FractionalMaxPool](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a748fe1a39c41a21d5eaf354b983739d3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const gtl::ArraySlice< float > & pooling_ratio)` |
| `[FractionalMaxPool](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a5f9caa3f2a12f0a745d2a5f77e52afb0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const gtl::ArraySlice< float > & pooling_ratio, const [FractionalMaxPool::Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[col\_pooling\_sequence](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a52a611a1c5972852d61e4c7c4dba6080)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fractional_max_pool_1afa035a8f78003fcb87dc8f51f24fb46a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a45380706ca834036886853c3913471b5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[row\_pooling\_sequence](#classtensorflow_1_1ops_1_1_fractional_max_pool_1af063f36da84313832493251d484684be)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Deterministic](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a0c955e2c96408a546047eebe8e002ee2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` |
| `[Overlapping](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a36d5917904da7ccac4be43359030e297)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` |
| `[PseudoRandom](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a9454041394465c0f816fabe29b8f1d8c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a29ada28331cd58de0b10f1fa54a3651b)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_fractional_max_pool_1a9e5bfbe203748402240a56db2df11d38)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FractionalMaxPool::Attrs](../../../struct/tensorflow/ops/fractional-max-pool/attrs) | Optional attribute setters for [FractionalMaxPool](fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool). |
Public attributes
-----------------
### col\_pooling\_sequence
```
::tensorflow::Output col_pooling_sequence
```
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
### row\_pooling\_sequence
```
::tensorflow::Output row_pooling_sequence
```
Public functions
----------------
### FractionalMaxPool
```
FractionalMaxPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const gtl::ArraySlice< float > & pooling_ratio
)
```
### FractionalMaxPool
```
FractionalMaxPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const gtl::ArraySlice< float > & pooling_ratio,
const FractionalMaxPool::Attrs & attrs
)
```
Public static functions
-----------------------
### Deterministic
```
Attrs Deterministic(
bool x
)
```
### Overlapping
```
Attrs Overlapping(
bool x
)
```
### PseudoRandom
```
Attrs PseudoRandom(
bool x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Conv2D tensorflow::ops::Conv2D
=======================
`#include <nn_ops.h>`
Computes a 2-D convolution given 4-D `input` and `filter` tensors.
Summary
-------
Given an input tensor of shape `[batch, in_height, in_width, in_channels]` and a filter / kernel tensor of shape `[filter_height, filter_width, in_channels, out_channels]`, this op performs the following:
1. Flattens the filter to a 2-D matrix with shape `[filter_height * filter_width * in_channels, output_channels]`.
2. Extracts image patches from the input tensor to form a *virtual* tensor of shape `[batch, out_height, out_width, filter_height * filter_width * in_channels]`.
3. For each patch, right-multiplies the filter matrix and the image patch vector.
In detail, with the default NHWC format,
```
output[b, i, j, k] =
sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] *
filter[di, dj, q, k]
```
Must have `strides[0] = strides[3] = 1`. For the most common case of the same horizontal and vertices strides, `strides = [1, stride, stride, 1]`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A 4-D tensor. The dimension order is interpreted according to the value of `data_format`, see below for details.
* filter: A 4-D tensor of shape `[filter_height, filter_width, in_channels, out_channels]`
* strides: 1-D tensor of length 4. The stride of the sliding window for each dimension of `input`. The dimension order is determined by the value of `data_format`, see below for details.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conv2-d/attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)`):
* explicit\_paddings: If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width].
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 4-D tensor. The dimension order is determined by the value of `data_format`, see below for details.
| Constructors and Destructors |
| --- |
| `[Conv2D](#classtensorflow_1_1ops_1_1_conv2_d_1ae27dd9789ca39f5241ef6169e9602d98)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[Conv2D](#classtensorflow_1_1ops_1_1_conv2_d_1a66103d912b58ddc4cc8630ff2aee7cdc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const [Conv2D::Attrs](../../../struct/tensorflow/ops/conv2-d/attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conv2_d_1af9ad760317104d0f49e840991ec3b098)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conv2_d_1aaa248db46e3bf2bdff1daf72d5548c36)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conv2_d_1a0792a7741b724bc96b71180628af6375)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conv2_d_1a9f4abe0db26277c44cb54ea09954944f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conv2_d_1ac956ca095c170eabe93569934e8d1eb8)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_conv2_d_1abb338036c1cdf1dca0ca58eb4a1f1226)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d/attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_conv2_d_1ad1fd4cc8dd1e6d6fe15d3f4d57352a4f)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d/attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_conv2_d_1a1745cff4561efd59e819a2374db7f925)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d/attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` |
| `[UseCudnnOnGpu](#classtensorflow_1_1ops_1_1_conv2_d_1ad94e81abdab43c58740cc2e9a522d35f)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d/attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Conv2D::Attrs](../../../struct/tensorflow/ops/conv2-d/attrs) | Optional attribute setters for [Conv2D](conv2-d#classtensorflow_1_1ops_1_1_conv2_d). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conv2D
```
Conv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### Conv2D
```
Conv2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const Conv2D::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
### UseCudnnOnGpu
```
Attrs UseCudnnOnGpu(
bool x
)
```
tensorflow_cpp tensorflow::ops::DecodeRaw tensorflow::ops::DecodeRaw
==========================
`#include <parsing_ops.h>`
Reinterpret the bytes of a string as a vector of numbers.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* bytes: [All](all#classtensorflow_1_1ops_1_1_all) the elements must have the same length.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-raw/attrs#structtensorflow_1_1ops_1_1_decode_raw_1_1_attrs)`):
* little\_endian: Whether the input `bytes` are in little-endian order. Ignored for `out_type` values that are stored in a single byte like `uint8`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) with one more dimension than the input `bytes`. The added dimension will have size equal to the length of the elements of `bytes` divided by the number of bytes to represent `out_type`.
| Constructors and Destructors |
| --- |
| `[DecodeRaw](#classtensorflow_1_1ops_1_1_decode_raw_1a009ee569ceb10dfe18f4cbc635c6b0f8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bytes, DataType out_type)` |
| `[DecodeRaw](#classtensorflow_1_1ops_1_1_decode_raw_1a2755ef7795b3379d5129b8a878bca31c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bytes, DataType out_type, const [DecodeRaw::Attrs](../../../struct/tensorflow/ops/decode-raw/attrs#structtensorflow_1_1ops_1_1_decode_raw_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_decode_raw_1ab6e42efe2dca3f3d827475cf62437053)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_decode_raw_1a23cf767ae870fefb89c30052498a0df6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_raw_1a7a6eccc4ac856a21aff11f122297916d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_raw_1a0eefc98977cc8232c00bc060f54ee941)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_raw_1a6d67d85b527ffa9d1d9598bc5388f3d2)() const` | |
| Public static functions |
| --- |
| `[LittleEndian](#classtensorflow_1_1ops_1_1_decode_raw_1a07817a63502629cb34ff94dadaaaceac)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-raw/attrs#structtensorflow_1_1ops_1_1_decode_raw_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodeRaw::Attrs](../../../struct/tensorflow/ops/decode-raw/attrs) | Optional attribute setters for [DecodeRaw](decode-raw#classtensorflow_1_1ops_1_1_decode_raw). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### DecodeRaw
```
DecodeRaw(
const ::tensorflow::Scope & scope,
::tensorflow::Input bytes,
DataType out_type
)
```
### DecodeRaw
```
DecodeRaw(
const ::tensorflow::Scope & scope,
::tensorflow::Input bytes,
DataType out_type,
const DecodeRaw::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### LittleEndian
```
Attrs LittleEndian(
bool x
)
```
tensorflow_cpp tensorflow::ops::MergeSummary tensorflow::ops::MergeSummary
=============================
`#include <logging_ops.h>`
Merges summaries.
Summary
-------
This op creates a [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) protocol buffer that contains the union of all the values in the input summaries.
When the Op is run, it reports an `InvalidArgument` error if multiple values in the summaries to merge use the same tag.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* inputs: Can be of any shape. Each must contain serialized `Summary` protocol buffers.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Scalar. Serialized `Summary` protocol buffer.
| Constructors and Destructors |
| --- |
| `[MergeSummary](#classtensorflow_1_1ops_1_1_merge_summary_1a22a47d3e7528edb0519809da7b7a4f4c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_merge_summary_1a1f99177e9a4c71b99dd573e69d99526a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[summary](#classtensorflow_1_1ops_1_1_merge_summary_1a06d974af5800758695c7f6cb4f173c36)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_merge_summary_1a22c07022fc4001bd71d2c519d992ba5a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_merge_summary_1a374205ab608f7a90c1d376ca539b3faa)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_merge_summary_1a2f1b90a972253c8960d1540dc4245cb4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### summary
```
::tensorflow::Output summary
```
Public functions
----------------
### MergeSummary
```
MergeSummary(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizedResizeBilinear tensorflow::ops::QuantizedResizeBilinear
========================================
`#include <image_ops.h>`
Resize quantized `images` to `size` using quantized bilinear interpolation.
Summary
-------
[Input](../input#classtensorflow_1_1_input) images and output images must be quantized types.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 4-D with shape `[batch, height, width, channels]`.
* size: = A 1-D int32 [Tensor](../tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/quantized-resize-bilinear/attrs#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs)`):
* align\_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` resized\_images: 4-D with shape `[batch, new_height, new_width, channels]`.
* `[Output](../output#classtensorflow_1_1_output)` out\_min
* `[Output](../output#classtensorflow_1_1_output)` out\_max
| Constructors and Destructors |
| --- |
| `[QuantizedResizeBilinear](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1ac52825879437da0b417099d2bf2bf983)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max)` |
| `[QuantizedResizeBilinear](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1ade5654aab42f16525de546477fc1b18e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max, const [QuantizedResizeBilinear::Attrs](../../../struct/tensorflow/ops/quantized-resize-bilinear/attrs#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1a842279002e4e0db02688d9d7035739a5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out\_max](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1a0c12681451cf41bdbdd5b4ce3e56276e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[out\_min](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1a2399c247560a6674f68332db798e9e99)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[resized\_images](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1a66faf15f60b9da85c98cd2fa1fa87205)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[AlignCorners](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1ab4769256e89a0e80457b29b8fe016d8e)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-resize-bilinear/attrs#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs)` |
| `[HalfPixelCenters](#classtensorflow_1_1ops_1_1_quantized_resize_bilinear_1ab47609a179b8e020f6dd1dc5c50fe9cd)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-resize-bilinear/attrs#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedResizeBilinear::Attrs](../../../struct/tensorflow/ops/quantized-resize-bilinear/attrs) | Optional attribute setters for [QuantizedResizeBilinear](quantized-resize-bilinear#classtensorflow_1_1ops_1_1_quantized_resize_bilinear). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out\_max
```
::tensorflow::Output out_max
```
### out\_min
```
::tensorflow::Output out_min
```
### resized\_images
```
::tensorflow::Output resized_images
```
Public functions
----------------
### QuantizedResizeBilinear
```
QuantizedResizeBilinear(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
::tensorflow::Input min,
::tensorflow::Input max
)
```
### QuantizedResizeBilinear
```
QuantizedResizeBilinear(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
::tensorflow::Input min,
::tensorflow::Input max,
const QuantizedResizeBilinear::Attrs & attrs
)
```
Public static functions
-----------------------
### AlignCorners
```
Attrs AlignCorners(
bool x
)
```
### HalfPixelCenters
```
Attrs HalfPixelCenters(
bool x
)
```
tensorflow_cpp tensorflow::ops::FIFOQueue tensorflow::ops::FIFOQueue
==========================
`#include <data_flow_ops.h>`
A queue that produces elements in first-in first-out order.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* component\_types: The type of each component in a value.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)`):
* shapes: The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time.
* capacity: The upper bound on the number of elements in this queue. Negative numbers mean no limit.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this queue will be shared under the given name across multiple sessions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to the queue.
| Constructors and Destructors |
| --- |
| `[FIFOQueue](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a1c4179dc27fa96d5281e93d9a3338692)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types)` |
| `[FIFOQueue](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1ac34f4b514c9af822272c71feb7f677b5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types, const [FIFOQueue::Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a278c966891168437dc2427d0153e906b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a5d87d19659d81485f7640003da0178a4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a66ea9cbb97c7e62c6aa576004425cdb4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1aa5121be97faefda41b54364feaa448b1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a2b012663c6c3edc28889f5c65791f216)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a9ebf2a962891d957c7e151de30bec6e1)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a409f6e87e8cab1a1346f65c79692f7b1)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` |
| `[Shapes](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a20662d0a789a4c8ebbad5f624937c20e)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_f_i_f_o_queue_1a47d8ebb6d1a6256e217e6878b87e8206)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FIFOQueue::Attrs](../../../struct/tensorflow/ops/f-i-f-o-queue/attrs) | Optional attribute setters for [FIFOQueue](f-i-f-o-queue#classtensorflow_1_1ops_1_1_f_i_f_o_queue). |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### FIFOQueue
```
FIFOQueue(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
```
### FIFOQueue
```
FIFOQueue(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types,
const FIFOQueue::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### Shapes
```
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::QueueClose tensorflow::ops::QueueClose
===========================
`#include <data_flow_ops.h>`
Closes the given queue.
Summary
-------
This operation signals that no more elements will be enqueued in the given queue. Subsequent Enqueue(Many) operations will fail. Subsequent Dequeue(Many) operations will continue to succeed if sufficient elements remain in the queue. Subsequent Dequeue(Many) operations that would block will fail immediately.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/queue-close/attrs#structtensorflow_1_1ops_1_1_queue_close_1_1_attrs)`):
* cancel\_pending\_enqueues: If true, all pending enqueue requests that are blocked on the given queue will be canceled.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[QueueClose](#classtensorflow_1_1ops_1_1_queue_close_1affd5807480aae31db63bf500e84c49f6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| `[QueueClose](#classtensorflow_1_1ops_1_1_queue_close_1af1fb16eb680ceab18ea2d05dbaa832d6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, const [QueueClose::Attrs](../../../struct/tensorflow/ops/queue-close/attrs#structtensorflow_1_1ops_1_1_queue_close_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_queue_close_1a7ef071ecc6a259c462a9df52160077e6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_queue_close_1af4c0fa38ce928f7ba0f4511436335b4f)() const` | |
| Public static functions |
| --- |
| `[CancelPendingEnqueues](#classtensorflow_1_1ops_1_1_queue_close_1a2df82e84083c2b54cccfad5f0d91ebcf)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/queue-close/attrs#structtensorflow_1_1ops_1_1_queue_close_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QueueClose::Attrs](../../../struct/tensorflow/ops/queue-close/attrs) | Optional attribute setters for [QueueClose](queue-close#classtensorflow_1_1ops_1_1_queue_close). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### QueueClose
```
QueueClose(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### QueueClose
```
QueueClose(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
const QueueClose::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### CancelPendingEnqueues
```
Attrs CancelPendingEnqueues(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyFtrlV2 tensorflow::ops::ResourceApplyFtrlV2
====================================
`#include <training_ops.h>`
Update '\*var' according to the Ftrl-proximal scheme.
Summary
-------
accum\_new = accum + grad \* grad grad\_with\_shrinkage = grad + 2 \* l2\_shrinkage \* var linear += grad\_with\_shrinkage + (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* linear: Should be from a Variable().
* grad: The gradient.
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 shrinkage regularization. Must be a scalar.
* lr\_power: Scaling factor. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyFtrlV2](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1af0cd2da7fd04b586801c7ff65201b3c6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` |
| `[ResourceApplyFtrlV2](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1a2ddc33ae007578e3d302ff7cd7da72bf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [ResourceApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1a055d8d299e112489bb08106d147d44be)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1a58cdd4377a81f3e98cc04b4cd0428827)() const` | |
| Public static functions |
| --- |
| `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1a20a15b7f33e31510150fa59b0df2bf38)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1a52d5b1bbc4f4f6722afad9df9b5ec209)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/resource-apply-ftrl-v2/attrs) | Optional attribute setters for [ResourceApplyFtrlV2](resource-apply-ftrl-v2#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyFtrlV2
```
ResourceApplyFtrlV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input l2_shrinkage,
::tensorflow::Input lr_power
)
```
### ResourceApplyFtrlV2
```
ResourceApplyFtrlV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input linear,
::tensorflow::Input grad,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input l2_shrinkage,
::tensorflow::Input lr_power,
const ResourceApplyFtrlV2::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### MultiplyLinearByLr
```
Attrs MultiplyLinearByLr(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Abs tensorflow::ops::Abs
====================
`#include <math_ops.h>`
Computes the absolute value of a tensor.
Summary
-------
Given a tensor `x`, this operation returns a tensor containing the absolute value of each element in `x`. For example, if x is an input element and y is an output element, this operation computes \(y = |x|\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Abs](#classtensorflow_1_1ops_1_1_abs_1af1551642c0434d6bfce213c528de889a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_abs_1ac82328eb20b58654c487efdd887ce1bf)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_abs_1a0ffd7a42a171ecc116fc8e0f0a725ecb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_abs_1a5a64e6857159fa40c20b7a45c29a2197)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_abs_1ab50b09f3b5ab613dda2b93fee1122d34)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_abs_1aecae91fd3292c4bf8c76ba3537ce0f0e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Abs
```
Abs(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::IdentityN tensorflow::ops::IdentityN
==========================
`#include <array_ops.h>`
Returns a list of tensors with the same shapes and contents as the input.
Summary
-------
tensors.
This op can be used to override the gradient for complicated functions. For example, suppose y = f(x) and we wish to apply a custom function g for backprop such that dx = g(dy). In Python,
```
with tf.get_default_graph().gradient_override_map(
{'IdentityN': 'OverrideGradientWithG'}):
y, _ = identity_n([f(x), x])
```
```
.RegisterGradient('OverrideGradientWithG')
def ApplyG(op, dy, _):
return [None, g(dy)] # Do not backprop to f(x).
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The output tensor.
| Constructors and Destructors |
| --- |
| `[IdentityN](#classtensorflow_1_1ops_1_1_identity_n_1a6643cba5b78cac36cc7b45f5e6ac03be)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_identity_n_1aab1042fbd2a1eb89667e580c77cda3db)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_identity_n_1adcada4788c180a31ade058caf543a8ce)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_identity_n_1ab03e879700560bb229b66d06d1bccc71)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::OutputList output
```
Public functions
----------------
### IdentityN
```
IdentityN(
const ::tensorflow::Scope & scope,
::tensorflow::InputList input
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
tensorflow_cpp tensorflow::ops::TensorArrayScatter tensorflow::ops::TensorArrayScatter
===================================
`#include <data_flow_ops.h>`
Scatter the data from the input value into specific [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements.
Summary
-------
`indices` must be a vector, its length must match the first dim of `value`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* indices: The locations at which to write the tensor elements.
* value: The concatenated tensor to write to the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* flow\_in: A float scalar that enforces proper chaining of operations.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A float scalar that enforces proper chaining of operations.
| Constructors and Destructors |
| --- |
| `[TensorArrayScatter](#classtensorflow_1_1ops_1_1_tensor_array_scatter_1ae395cc4ed95e12333da59c82e4e38375)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in)` |
| Public attributes |
| --- |
| `[flow\_out](#classtensorflow_1_1ops_1_1_tensor_array_scatter_1a09d94e74e1687408a15eb0a2ea5a83ff)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_scatter_1a011e617705e997f4b6977010f194731a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_array_scatter_1a507abb2912dccfd0f76902363c64a87a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_array_scatter_1a5eced0b51154d4d039b99bab78d8c327)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_array_scatter_1a4667482ae23579f85db4b6a78b2d9774)() const` | |
Public attributes
-----------------
### flow\_out
```
::tensorflow::Output flow_out
```
### operation
```
Operation operation
```
Public functions
----------------
### TensorArrayScatter
```
TensorArrayScatter(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input indices,
::tensorflow::Input value,
::tensorflow::Input flow_in
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Bitcast tensorflow::ops::Bitcast
========================
`#include <array_ops.h>`
Bitcasts a tensor from one type to another without copying data.
Summary
-------
Given a tensor `input`, this operation returns a tensor that has the same buffer data as `input` with datatype `type`.
If the input datatype `T` is larger than the output datatype `type` then the shape changes from [...] to [..., sizeof(`T`)/sizeof(`type`)].
If `T` is smaller than `type`, the operator requires that the rightmost dimension be equal to sizeof(`type`)/sizeof(`T`). The shape then goes from [..., sizeof(`type`)/sizeof(`T`)] to [...].
tf.bitcast() and tf.cast() work differently when real dtype is casted as a complex dtype (e.g. tf.complex64 or tf.complex128) as tf.cast() make imaginary part 0 while tf.bitcast() gives module error. For example,
Example 1:
a = [1., 2., 3.] equality\_bitcast = tf.bitcast(a, tf.complex128) Traceback (most recent call last): ... InvalidArgumentError: Cannot bitcast from 1 to 18 [Op:[Bitcast](bitcast#classtensorflow_1_1ops_1_1_bitcast)] equality\_cast = tf.cast(a, tf.complex128) print(equality\_cast) tf.Tensor([1.+0.j 2.+0.j 3.+0.j], shape=(3,), dtype=complex128)
Example 2:
tf.bitcast(tf.constant(0xffffffff, dtype=tf.uint32), tf.uint8)
Example 3:
x = [1., 2., 3.] y = [0., 2., 3.] equality= tf.equal(x,y) equality\_cast = tf.cast(equality,tf.float32) equality\_bitcast = tf.bitcast(equality\_cast,tf.uint8) print(equality) tf.Tensor([False True True], shape=(3,), dtype=bool) print(equality\_cast) tf.Tensor([0. 1. 1.], shape=(3,), dtype=float32) print(equality\_bitcast) tf.Tensor( [[ 0 0 0 0] [ 0 0 128 63] [ 0 0 128 63]], shape=(3, 4), dtype=uint8)
*NOTE*: [Bitcast](bitcast#classtensorflow_1_1ops_1_1_bitcast) is implemented as a low-level cast, so machines with different endian orderings will give different results.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Bitcast](#classtensorflow_1_1ops_1_1_bitcast_1a05bc5afdb6742a02847bb3a8d621b149)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, DataType type)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_bitcast_1a73096d45a2f9d4344e1129af8152435c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_bitcast_1a4b3a50f16d6247d11bfe2d42f5a438fd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_bitcast_1a999d383445adeaf4c5306b84acc32444)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bitcast_1a26b9e16d876ed44fa37352c733696aec)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bitcast_1ad3b38ccb536d06b4ce4f2f48af30b1f5)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Bitcast
```
Bitcast(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
DataType type
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseApplyProximalGradientDescent tensorflow::ops::SparseApplyProximalGradientDescent
===================================================
`#include <training_ops.h>`
Sparse update '\*var' as FOBOS algorithm with fixed learning rate.
Summary
-------
That is for rows we have grad for, we update var as follows: $$prox\_v = var - alpha \* grad$$ $$var = sign(prox\_v)/(1+alpha\*l2) \* max{|prox\_v|-alpha\*l1,0}$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* alpha: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs)`):
* use\_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a372f39ab528e739f2009829f8209517b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[SparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a8ba255097ba97fd395eb2528cf675341)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [SparseApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a8787a4b4f05f63e721e95dc8c8ae25e6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a0f7e7354d7d857df6ba06081c84b4f97)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a479c0fc042fbe24ce695f756d8254d0b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a94b9654761c297155f6b1ad3a8aa86e2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1af963b74c94589fa8d01e7c6731da53f1)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1ad1049d2df604f472a032326555f15024)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs) | Optional attribute setters for [SparseApplyProximalGradientDescent](sparse-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyProximalGradientDescent
```
SparseApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### SparseApplyProximalGradientDescent
```
SparseApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices,
const SparseApplyProximalGradientDescent::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::DecodeImage tensorflow::ops::DecodeImage
============================
`#include <image_ops.h>`
Function for decode\_bmp, decode\_gif, decode\_jpeg, and decode\_png.
Summary
-------
Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the appropriate operation to convert the input bytes string into a [Tensor](../tensor#classtensorflow_1_1_tensor) of type dtype.
*NOTE*: decode\_gif returns a 4-D array [num\_frames, height, width, 3], as opposed to decode\_bmp, decode\_jpeg and decode\_png, which return 3-D arrays [height, width, num\_channels]. Make sure to take this into account when constructing your graph if you are intermixing GIF files with BMP, JPEG, and/or PNG files. Alternately, set the expand\_animations argument of this function to False, in which case the op will return 3-dimensional tensors and will truncate animated GIF files to the first frame.
*NOTE*: If the first frame of an animated GIF does not occupy the entire canvas (maximum frame width x maximum frame height), then it fills the unoccupied areas (in the first frame) with zeros (black). For frames after the first frame that does not occupy the entire canvas, it uses the previous frame to fill the unoccupied areas.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* contents: 0-D. The encoded image bytes.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)`):
* channels: Number of color channels for the decoded image.
* dtype: The desired DType of the returned [Tensor](../tensor#classtensorflow_1_1_tensor).
* expand\_animations: Controls the output shape of the returned op. If True, the returned op will produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or not. If, False, the returned op will produce a 3-D tensor for all file types and will truncate animated GIFs to the first frame.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D with shape `[height, width, channels]` or 4-D with shape `[frame, height, width, channels]`..
| Constructors and Destructors |
| --- |
| `[DecodeImage](#classtensorflow_1_1ops_1_1_decode_image_1abfe660ccb54018226f2c9996ecbf3c18)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| `[DecodeImage](#classtensorflow_1_1ops_1_1_decode_image_1acc94a29044649186bbaeae5ea7f6873d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, const [DecodeImage::Attrs](../../../struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[image](#classtensorflow_1_1ops_1_1_decode_image_1a62ff2512dc732de4d362ff6f3b8abb46)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_decode_image_1a30fff2e0d4b15969c8b4ce06072682fc)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_image_1a6077da2c6006ea12234e0b88d5a469f5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_image_1aff2862dcabe12bf553b2fef38d64ea85)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_image_1a1ba8b5d74537595560c28dccb6ccdf38)() const` | |
| Public static functions |
| --- |
| `[Channels](#classtensorflow_1_1ops_1_1_decode_image_1ac86e16998082169eda98bb162f933d33)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)` |
| `[Dtype](#classtensorflow_1_1ops_1_1_decode_image_1a503537bd342c512196908e619961f4dd)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)` |
| `[ExpandAnimations](#classtensorflow_1_1ops_1_1_decode_image_1a0e5f662b9728514d9dcc84f1b2483ab7)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-image/attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodeImage::Attrs](../../../struct/tensorflow/ops/decode-image/attrs) | Optional attribute setters for [DecodeImage](decode-image#classtensorflow_1_1ops_1_1_decode_image). |
Public attributes
-----------------
### image
```
::tensorflow::Output image
```
### operation
```
Operation operation
```
Public functions
----------------
### DecodeImage
```
DecodeImage(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents
)
```
### DecodeImage
```
DecodeImage(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents,
const DecodeImage::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Channels
```
Attrs Channels(
int64 x
)
```
### Dtype
```
Attrs Dtype(
DataType x
)
```
### ExpandAnimations
```
Attrs ExpandAnimations(
bool x
)
```
tensorflow_cpp tensorflow::ops::TruncateDiv tensorflow::ops::TruncateDiv
============================
`#include <math_ops.h>`
Returns x / y element-wise for integer types.
Summary
-------
Truncation designates that negative numbers will round fractional quantities toward zero. I.e. -7 / 5 = -1. This matches C semantics but it is different than Python semantics. See `[FloorDiv](floor-div#classtensorflow_1_1ops_1_1_floor_div)` for a division function that matches Python Semantics.
*NOTE*: `[TruncateDiv](truncate-div#classtensorflow_1_1ops_1_1_truncate_div)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[TruncateDiv](#classtensorflow_1_1ops_1_1_truncate_div_1a85d194acc237ad25c4251ae3146881fc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_truncate_div_1a7e0de478587246e3cbd2f20d632e1855)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_truncate_div_1ac337c45837a1c775c7cdb6f0507183a1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_truncate_div_1a02a14b9ad45aae76def58326dcf595f4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_truncate_div_1af97d794f682f7ae28fab09b5a090ffa5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_truncate_div_1af687d5b0bf86a1f3d96743ec9a7b5525)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### TruncateDiv
```
TruncateDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApplyPowerSign tensorflow::ops::ApplyPowerSign
===============================
`#include <training_ops.h>`
Update '\*var' according to the AddSign update.
Summary
-------
m\_t <- beta1 \* m\_{t-1} + (1 - beta1) \* g update <- exp(logbase \* sign\_decay \* sign(g) \* sign(m\_t)) \* g variable <- variable - lr\_t \* update
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* logbase: Must be a scalar.
* sign\_decay: Must be a scalar.
* beta: Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-power-sign/attrs#structtensorflow_1_1ops_1_1_apply_power_sign_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyPowerSign](#classtensorflow_1_1ops_1_1_apply_power_sign_1a4083d7676778fbebe38c5aa3906ba573)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logbase, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyPowerSign](#classtensorflow_1_1ops_1_1_apply_power_sign_1ac5cfe9375414e3da6ffa6c6b7dbb6c98)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logbase, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyPowerSign::Attrs](../../../struct/tensorflow/ops/apply-power-sign/attrs#structtensorflow_1_1ops_1_1_apply_power_sign_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_power_sign_1a5125592ade433f2862686ad54eb00a35)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_power_sign_1aa6f4cf4bacd1b8ac2217f5656510684a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_power_sign_1a9f0df057bae65b3e62d1af2fe740ca6e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_power_sign_1ab8353f9957efd29b24c59cd7dbe1fdc0)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_power_sign_1a037ed37ac4be6ba570f480c133a10bcb)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_power_sign_1a38f6aeb17f19ce776fc5c256f0d94082)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-power-sign/attrs#structtensorflow_1_1ops_1_1_apply_power_sign_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyPowerSign::Attrs](../../../struct/tensorflow/ops/apply-power-sign/attrs) | Optional attribute setters for [ApplyPowerSign](apply-power-sign#classtensorflow_1_1ops_1_1_apply_power_sign). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyPowerSign
```
ApplyPowerSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input logbase,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad
)
```
### ApplyPowerSign
```
ApplyPowerSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input logbase,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad,
const ApplyPowerSign::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseReduceSum tensorflow::ops::SparseReduceSum
================================
`#include <sparse_ops.h>`
Computes the sum of elements across dimensions of a SparseTensor.
Summary
-------
This Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_sum()`. In particular, this Op also returns a dense `[Tensor](../tensor#classtensorflow_1_1_tensor)` instead of a sparse one.
Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained with length 1.
If `reduction_axes` has no entries, all dimensions are reduced, and a tensor with a single element is returned. Additionally, the axes can be negative, which are interpreted according to the indexing rules in Python.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* input\_values: 1-D. `N` non-empty values corresponding to `input_indices`.
* input\_shape: 1-D. Shape of the input SparseTensor.
* reduction\_axes: 1-D. Length-`K` vector containing the reduction axes.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_1_1_attrs)`):
* keep\_dims: If true, retain reduced dimensions with length 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: `R-K`-D. The reduced [Tensor](../tensor#classtensorflow_1_1_tensor).
| Constructors and Destructors |
| --- |
| `[SparseReduceSum](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a31f677c3b19d0710fb02fab6474e8f18)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes)` |
| `[SparseReduceSum](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a8d3151db2dd2eaf6a347aed70d3bb7ec)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_axes, const [SparseReduceSum::Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a4d9aa91a20be8c1e507dbbaf92bc5fee)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a7e00bc9e8f78ba705bbdcb0c00ccafb4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a61bca8cf985cd2ede755ad70f8a24159)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a07a158d5f8094c296f78a42957ca9618)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a49009e1c5d20e23d3069807f419177ac)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_sparse_reduce_sum_1a673e06d6ba6fee5fe24fa8044a62ca1c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseReduceSum::Attrs](../../../struct/tensorflow/ops/sparse-reduce-sum/attrs) | Optional attribute setters for [SparseReduceSum](sparse-reduce-sum#classtensorflow_1_1ops_1_1_sparse_reduce_sum). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseReduceSum
```
SparseReduceSum(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes
)
```
### SparseReduceSum
```
SparseReduceSum(
const ::tensorflow::Scope & scope,
::tensorflow::Input input_indices,
::tensorflow::Input input_values,
::tensorflow::Input input_shape,
::tensorflow::Input reduction_axes,
const SparseReduceSum::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
tensorflow_cpp tensorflow::ops::EncodeBase64 tensorflow::ops::EncodeBase64
=============================
`#include <string_ops.h>`
Encode strings into web-safe base64 format.
Summary
-------
Refer to [this article](https://en.wikipedia.org/wiki/Base64) for more information on base64 format. Base64 strings may have padding with '=' at the end so that the encoded has length multiple of 4. See Padding section of the link above.
Web-safe means that the encoder uses - and \_ instead of + and /.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Strings to be encoded.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/encode-base64/attrs#structtensorflow_1_1ops_1_1_encode_base64_1_1_attrs)`):
* pad: Bool whether padding is applied at the ends.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: [Input](../input#classtensorflow_1_1_input) strings encoded in base64.
| Constructors and Destructors |
| --- |
| `[EncodeBase64](#classtensorflow_1_1ops_1_1_encode_base64_1aa8371d913db405206464bd4233fa039d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[EncodeBase64](#classtensorflow_1_1ops_1_1_encode_base64_1ae7ca70eace547ac3fb404fd8d983a551)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [EncodeBase64::Attrs](../../../struct/tensorflow/ops/encode-base64/attrs#structtensorflow_1_1ops_1_1_encode_base64_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_encode_base64_1ac88d3a2d0a09fdcf5c1e0e6099a9f436)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_encode_base64_1a1232737d3ebffc26955c0a6880d67cbe)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_encode_base64_1aa8ffb94009c50322dcd63f4cfdcc1cbd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_encode_base64_1aa42e45f58ca5cbd43c3f5f4d231fba66)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_encode_base64_1ae324f09566207fb6e063b62fd9f05085)() const` | |
| Public static functions |
| --- |
| `[Pad](#classtensorflow_1_1ops_1_1_encode_base64_1ab5b29f0638a3ab4764ba81d707ef89da)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/encode-base64/attrs#structtensorflow_1_1ops_1_1_encode_base64_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::EncodeBase64::Attrs](../../../struct/tensorflow/ops/encode-base64/attrs) | Optional attribute setters for [EncodeBase64](encode-base64#classtensorflow_1_1ops_1_1_encode_base64). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### EncodeBase64
```
EncodeBase64(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### EncodeBase64
```
EncodeBase64(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const EncodeBase64::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Pad
```
Attrs Pad(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::DeserializeSparse tensorflow::ops::DeserializeSparse
==================================
`#include <sparse_ops.h>`
Deserialize `SparseTensor` objects.
Summary
-------
The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where the last dimension stores serialized `SparseTensor` objects and the other N dimensions (N >= 0) correspond to a batch. The ranks of the original `SparseTensor` objects must all match. When the final `SparseTensor` is created, its rank is the rank of the incoming `SparseTensor` objects plus N; the sparse tensors have been concatenated along new dimensions, one for each batch.
The output `SparseTensor` object's shape values for the original dimensions are the max across the input `SparseTensor` objects' shape values for the corresponding dimensions. The new dimensions match the size of the batch.
The input `SparseTensor` objects' indices are assumed ordered in standard lexicographic order. If this is not the case, after this step run `[SparseReorder](sparse-reorder#classtensorflow_1_1ops_1_1_sparse_reorder)` to restore index ordering.
For example, if the serialized input is a `[2 x 3]` matrix representing two original `SparseTensor` objects:
```
index = [ 0]
[10]
[20]
values = [1, 2, 3]
shape = [50]
```
and
```
index = [ 2]
[10]
values = [4, 5]
shape = [30]
```
then the final deserialized `SparseTensor` will be:
```
index = [0 0]
[0 10]
[0 20]
[1 2]
[1 10]
values = [1, 2, 3, 4, 5]
shape = [2 50]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized\_sparse: The serialized `SparseTensor` objects. The last dimension must have 3 columns.
* dtype: The `dtype` of the serialized `SparseTensor` objects.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sparse\_indices
* `[Output](../output#classtensorflow_1_1_output)` sparse\_values
* `[Output](../output#classtensorflow_1_1_output)` sparse\_shape
| Constructors and Destructors |
| --- |
| `[DeserializeSparse](#classtensorflow_1_1ops_1_1_deserialize_sparse_1a023794d9b956960ff8d7189e5e3feec5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized_sparse, DataType dtype)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_deserialize_sparse_1abdd692db872e045ede9e84be66b35bc3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sparse\_indices](#classtensorflow_1_1ops_1_1_deserialize_sparse_1acdaf19772a1be03384f76ac4e07f6aaf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sparse\_shape](#classtensorflow_1_1ops_1_1_deserialize_sparse_1a86bbd4ffa415bb68db5fa2f1e76e7de5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sparse\_values](#classtensorflow_1_1ops_1_1_deserialize_sparse_1a303201bfe16885e2cef2b115049d005e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### sparse\_indices
```
::tensorflow::Output sparse_indices
```
### sparse\_shape
```
::tensorflow::Output sparse_shape
```
### sparse\_values
```
::tensorflow::Output sparse_values
```
Public functions
----------------
### DeserializeSparse
```
DeserializeSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized_sparse,
DataType dtype
)
```
tensorflow_cpp tensorflow::ops::L2Loss tensorflow::ops::L2Loss
=======================
`#include <nn_ops.h>`
L2 Loss.
Summary
-------
Computes half the L2 norm of a tensor without the `sqrt`:
```
output = sum(t ** 2) / 2
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* t: Typically 2-D, but may have any dimensions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 0-D.
| Constructors and Destructors |
| --- |
| `[L2Loss](#classtensorflow_1_1ops_1_1_l2_loss_1a595112ba30938b3d821dd5d7ade896ce)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) t)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_l2_loss_1aa4ef80dec6a4c63c50065b43a205ddff)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_l2_loss_1a9907900c49e78c512ba25a93c8737b42)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_l2_loss_1af18c04f060f27a407e1e906362251dd8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_l2_loss_1a339da03f537d6b37b058d6ae58673673)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_l2_loss_1a190fdff9721343a1c2b604f9427463e4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### L2Loss
```
L2Loss(
const ::tensorflow::Scope & scope,
::tensorflow::Input t
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ScatterMin tensorflow::ops::ScatterMin
===========================
`#include <state_ops.h>`
Reduces sparse updates into a variable reference using the `min` operation.
Summary
-------
This operation computes
```
# Scalar indices
ref[indices, ...] = min(ref[indices, ...], updates[...])
# Vector indices (for each i)
ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
# High rank indices (for each i, ..., j)
ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
```
This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value.
Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions combine.
Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`.

Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* indices: A tensor of indices into the first dimension of `ref`.
* updates: A tensor of updated values to reduce into `ref`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-min/attrs#structtensorflow_1_1ops_1_1_scatter_min_1_1_attrs)`):
* use\_locking: If True, the update will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterMin](#classtensorflow_1_1ops_1_1_scatter_min_1a20672036c077b2295fe3b7f263f1cbbc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterMin](#classtensorflow_1_1ops_1_1_scatter_min_1a970f0ae60aca198d4ff561223d356190)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterMin::Attrs](../../../struct/tensorflow/ops/scatter-min/attrs#structtensorflow_1_1ops_1_1_scatter_min_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_min_1a6b8f4f0a291a0a5110af72304126dfda)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_min_1a246255cec7f7a96a7aaec14b4b44b6b7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_min_1ad2e63dcee002a733c8a1c255be7b2683)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_min_1a8938d32752649aeaeba42f68891ababc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_min_1af6605bb1184a6c918a33ba5d6389874b)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_min_1a81d4614aac5d7b4ec68e2513034b2970)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-min/attrs#structtensorflow_1_1ops_1_1_scatter_min_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterMin::Attrs](../../../struct/tensorflow/ops/scatter-min/attrs) | Optional attribute setters for [ScatterMin](scatter-min#classtensorflow_1_1ops_1_1_scatter_min). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterMin
```
ScatterMin(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterMin
```
ScatterMin(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterMin::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::UnsortedSegmentMax tensorflow::ops::UnsortedSegmentMax
===================================
`#include <math_ops.h>`
Computes the maximum along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
This operator is similar to `tf.math.unsorted_segment_sum`, Instead of computing the sum over segments, it computes the maximum such that:
\(output\_i = \max\_{j...} data[j...]\) where max is over tuples `j...` such that `segment_ids[j...] == i`.
If the maximum is empty for a given segment ID `i`, it outputs the smallest possible value for the specific numeric type, `output[i] = numeric_limits::lowest()`.
If the given segment ID `i` is negative, then the corresponding value is dropped, and will not be included in the result.
Caution: On CPU, values in `segment_ids` are always validated to be less than `num_segments`, and an error is thrown for out-of-bound indices. On GPU, this does not throw an error for out-of-bound indices. On Gpu, out-of-bound indices result in safe but unspecified behavior, which may include ignoring out-of-bound indices or outputting a tensor with a 0 stored in the first dimension of its shape if `num_segments` is 0.

For example:
c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]]) tf.math.unsorted\_segment\_max(c, tf.constant([0, 1, 0]), num\_segments=2).numpy() array([[4, 3, 3, 4], [5, 6, 7, 8]], dtype=int32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A tensor whose shape is a prefix of `data.shape`. The values must be less than `num_segments`.
Caution: The values are always validated to be in range on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for the first `segment_ids.rank` dimensions, which are replaced with a single dimension which has size `num_segments`.
| Constructors and Destructors |
| --- |
| `[UnsortedSegmentMax](#classtensorflow_1_1ops_1_1_unsorted_segment_max_1aeb19f031754890ec47ed4697181ad221)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_unsorted_segment_max_1a9df170fe16bf74c048a7ff8b8d8e55b2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_unsorted_segment_max_1a7406a8b8c43e7add9be33843cced1a48)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_unsorted_segment_max_1a3655cb1e37a6e8dca92fd481d04ce919)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unsorted_segment_max_1a482d2d791129d646d9781c61e2d457bf)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unsorted_segment_max_1a06ee890e348271ba3c04223c6149d5a7)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### UnsortedSegmentMax
```
UnsortedSegmentMax(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseSegmentMeanWithNumSegments tensorflow::ops::SparseSegmentMeanWithNumSegments
=================================================
`#include <math_ops.h>`
Computes the mean along sparse segments of a tensor.
Summary
-------
Like `[SparseSegmentMean](sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean)`, but allows missing ids in `segment_ids`. If an id is missing, the `output` tensor at that position will be zeroed.
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: A 1-D tensor. Has same rank as `segment_ids`.
* segment\_ids: A 1-D tensor. Values should be sorted and can be repeated.
* num\_segments: Should equal the number of distinct segment IDs.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `num_segments`.
| Constructors and Destructors |
| --- |
| `[SparseSegmentMeanWithNumSegments](#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1acc14eb336c9bb422d63a332e5ff475aa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a1750008c63c66918b6adeac3d952ecef)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a7a024ed618e930ac1bea2d738bd0f394)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1ab959360a1d82011d10097010d5274941)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a0856c9bfce8692ac6cfaf403591e8d4e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_mean_with_num_segments_1a298a1bf3fbf9b34d2c306955c3090ff8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentMeanWithNumSegments
```
SparseSegmentMeanWithNumSegments(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input indices,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Dilation2DBackpropFilter tensorflow::ops::Dilation2DBackpropFilter
=========================================
`#include <nn_ops.h>`
Computes the gradient of morphological 2-D dilation with respect to the filter.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, in_height, in_width, depth]`.
* filter: 3-D with shape `[filter_height, filter_width, depth]`.
* out\_backprop: 4-D with shape `[batch, out_height, out_width, depth]`.
* strides: 1-D of length 4. The stride of the sliding window for each dimension of the input tensor. Must be: `[1, stride_height, stride_width, 1]`.
* rates: 1-D of length 4. The input stride for atrous morphological dilation. Must be: `[1, rate_height, rate_width, 1]`.
* padding: The type of padding algorithm to use.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D with shape `[filter_height, filter_width, depth]`.
| Constructors and Destructors |
| --- |
| `[Dilation2DBackpropFilter](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_filter_1aee49e72aa07dcbf88c90408b543ba72a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, const gtl::ArraySlice< int > & rates, StringPiece padding)` |
| Public attributes |
| --- |
| `[filter\_backprop](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_filter_1aff315faa81312d2ca485e7c28efcf7a1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_filter_1a379a354e0afad94b4293ada896ac216f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_filter_1a898f6b25dd172dada5bf224b4dcffcf3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_filter_1a6b2a7299a1107ed932922ef42590de8d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_dilation2_d_backprop_filter_1a905c516c8e2e46de5e1b24f8f2f37d41)() const` | |
Public attributes
-----------------
### filter\_backprop
```
::tensorflow::Output filter_backprop
```
### operation
```
Operation operation
```
Public functions
----------------
### Dilation2DBackpropFilter
```
Dilation2DBackpropFilter(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
const gtl::ArraySlice< int > & rates,
StringPiece padding
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::HistogramSummary tensorflow::ops::HistogramSummary
=================================
`#include <logging_ops.h>`
Outputs a `Summary` protocol buffer with a histogram.
Summary
-------
The generated [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) has one summary value containing a histogram for `values`.
This op reports an `InvalidArgument` error if any value is not finite.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* tag: Scalar. Tag to use for the `Summary.Value`.
* values: [Any](any#classtensorflow_1_1ops_1_1_any) shape. Values to use to build the histogram.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Scalar. Serialized `Summary` protocol buffer.
| Constructors and Destructors |
| --- |
| `[HistogramSummary](#classtensorflow_1_1ops_1_1_histogram_summary_1aaab802eb624b382eb005e34e3ada6d10)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tag, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_histogram_summary_1a7f612489c63d540365a108d7200ea648)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[summary](#classtensorflow_1_1ops_1_1_histogram_summary_1a96bffbe34e8235b5091ad78443e01e1f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_histogram_summary_1a6c06cc9d888d66d900b23529d4fdf343)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_histogram_summary_1aae75ef126ce566342f0b0053dd71a25a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_histogram_summary_1a14a995ac4e19bf7348659ef7f3f66306)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### summary
```
::tensorflow::Output summary
```
Public functions
----------------
### HistogramSummary
```
HistogramSummary(
const ::tensorflow::Scope & scope,
::tensorflow::Input tag,
::tensorflow::Input values
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ResourceApplyProximalAdagrad tensorflow::ops::ResourceApplyProximalAdagrad
=============================================
`#include <training_ops.h>`
Update '\*var' and '\*accum' according to FOBOS with Adagrad learning rate.
Summary
-------
accum += grad \* grad prox\_v = var - lr \* grad \* (1 / sqrt(accum)) var = sign(prox\_v)/(1+lr\*l2) \* max{|prox\_v|-lr\*l1,0}
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1a3dc55415535e03c9cac239c5a41cc904)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1aef70d8bf8ea9923d3b3cfee71c18ce95)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1a4d1aa9f9c24bfc7d4749104b34445a51)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1a3c9634c10514a058357571fec4a3367b)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1a809b5b01e1c468c84f9bf66915a60e50)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-adagrad/attrs) | Optional attribute setters for [ResourceApplyProximalAdagrad](resource-apply-proximal-adagrad#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyProximalAdagrad
```
ResourceApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad
)
```
### ResourceApplyProximalAdagrad
```
ResourceApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
const ResourceApplyProximalAdagrad::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Range tensorflow::ops::Range
======================
`#include <math_ops.h>`
Creates a sequence of numbers.
Summary
-------
This operation creates a sequence of numbers that begins at `start` and extends by increments of `delta` up to but not including `limit`.
For example:
```
# 'start' is 3
# 'limit' is 18
# 'delta' is 3
tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* start: 0-D (scalar). First entry in the sequence.
* limit: 0-D (scalar). Upper limit of sequence, exclusive.
* delta: 0-D (scalar). Optional. Default is 1. Number that increments `start`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D.
| Constructors and Destructors |
| --- |
| `[Range](#classtensorflow_1_1ops_1_1_range_1ac89f10cd7a02658f009b001297b9e39d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) start, ::[tensorflow::Input](../input#classtensorflow_1_1_input) limit, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_range_1a6bb875b501983ede4f2c3eb9cbfe30ee)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_range_1a408459e47f930b28694661838962ba5e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_range_1ac9b5f6727feb82935fd0bbfb3cebcbef)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_range_1a810a3ce642e4e22f25f72fffbfc12d3c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_range_1ae4e7344666bfe134a81298ac5d7d86cd)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Range
```
Range(
const ::tensorflow::Scope & scope,
::tensorflow::Input start,
::tensorflow::Input limit,
::tensorflow::Input delta
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::OrderedMapPeek tensorflow::ops::OrderedMapPeek
===============================
`#include <data_flow_ops.h>`
Op peeks at the values at the specified key.
Summary
-------
If the
underlying container does not contain this key this op will block until it does. This Op is optimized for performance.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The values tensor.
| Constructors and Destructors |
| --- |
| `[OrderedMapPeek](#classtensorflow_1_1ops_1_1_ordered_map_peek_1a7369b657806eaeb6625d30e025df00a6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes)` |
| `[OrderedMapPeek](#classtensorflow_1_1ops_1_1_ordered_map_peek_1ab385fea4daa9faee11028099a6cebc73)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes, const [OrderedMapPeek::Attrs](../../../struct/tensorflow/ops/ordered-map-peek/attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ordered_map_peek_1a87ecb8d598a192235367430dec546a21)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_ordered_map_peek_1aaf61d9094f0f21072119bba177760835)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_ordered_map_peek_1a1f534178cb6f8bca468efe3aaa1926df)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_peek_1abbde446197b0277fb1de7807fcb684e6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-peek/attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_ordered_map_peek_1a82c6df8a1750de9f195e6232112ba674)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-peek/attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_peek_1aa16ba5dd51d11ebaef238635bcb6a654)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-peek/attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_peek_1a18081f288cbd98a96af948480169c070)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-peek/attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OrderedMapPeek::Attrs](../../../struct/tensorflow/ops/ordered-map-peek/attrs) | Optional attribute setters for [OrderedMapPeek](ordered-map-peek#classtensorflow_1_1ops_1_1_ordered_map_peek). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### OrderedMapPeek
```
OrderedMapPeek(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes
)
```
### OrderedMapPeek
```
OrderedMapPeek(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes,
const OrderedMapPeek::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::GatherNd tensorflow::ops::GatherNd
=========================
`#include <array_ops.h>`
[Gather](gather#classtensorflow_1_1ops_1_1_gather) slices from `params` into a [Tensor](../tensor#classtensorflow_1_1_tensor) with shape specified by `indices`.
Summary
-------
`indices` is a K-dimensional integer tensor, best thought of as a (K-1)-dimensional tensor of indices into `params`, where each element defines a slice of `params`:
```
output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]]
```
Whereas in `tf.gather``indices` defines slices into the `axis` dimension of `params`, in `tf.gather_nd`, `indices` defines slices into the first `N` dimensions of `params`, where `N = indices.shape[-1]`.
The last dimension of `indices` can be at most the rank of `params`:
```
indices.shape[-1] <= params.rank
```
The last dimension of `indices` corresponds to elements (if `indices.shape[-1] == params.rank`) or slices (if `indices.shape[-1] < params.rank`) along dimension `indices.shape[-1]` of `params`. The output tensor has shape
```
indices.shape[:-1] + params.shape[indices.shape[-1]:]
```
Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, a 0 is stored in the corresponding output value.
Some examples below.
Simple indexing into a matrix:
```
indices = [[0, 0], [1, 1]]
params = [['a', 'b'], ['c', 'd']]
output = ['a', 'd']
```
Slice indexing into a matrix:
```
indices = [[1], [0]]
params = [['a', 'b'], ['c', 'd']]
output = [['c', 'd'], ['a', 'b']]
```
Indexing into a 3-tensor:
```
indices = [[1]]
params = [[['a0', 'b0'], ['c0', 'd0']],
[['a1', 'b1'], ['c1', 'd1']]]
output = [[['a1', 'b1'], ['c1', 'd1']]]
```
```
indices = [[0, 1], [1, 0]]
params = [[['a0', 'b0'], ['c0', 'd0']],
[['a1', 'b1'], ['c1', 'd1']]]
output = [['c0', 'd0'], ['a1', 'b1']]
```
```
indices = [[0, 0, 1], [1, 0, 1]]
params = [[['a0', 'b0'], ['c0', 'd0']],
[['a1', 'b1'], ['c1', 'd1']]]
output = ['b0', 'b1']
```
Batched indexing into a matrix:
```
indices = [[[0, 0]], [[0, 1]]]
params = [['a', 'b'], ['c', 'd']]
output = [['a'], ['b']]
```
Batched slice indexing into a matrix:
```
indices = [[[1]], [[0]]]
params = [['a', 'b'], ['c', 'd']]
output = [[['c', 'd']], [['a', 'b']]]
```
Batched indexing into a 3-tensor:
```
indices = [[[1]], [[0]]]
params = [[['a0', 'b0'], ['c0', 'd0']],
[['a1', 'b1'], ['c1', 'd1']]]
output = [[[['a1', 'b1'], ['c1', 'd1']]],
[[['a0', 'b0'], ['c0', 'd0']]]]
```
```
indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]]
params = [[['a0', 'b0'], ['c0', 'd0']],
[['a1', 'b1'], ['c1', 'd1']]]
output = [[['c0', 'd0'], ['a1', 'b1']],
[['a0', 'b0'], ['c1', 'd1']]]
```
```
indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]]
params = [[['a0', 'b0'], ['c0', 'd0']],
[['a1', 'b1'], ['c1', 'd1']]]
output = [['b0', 'b1'], ['d0', 'c1']]
```
See also `tf.gather` and `tf.batch_gather`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* params: The tensor from which to gather values.
* indices: Index tensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Values from `params` gathered from indices given by `indices`, with shape `indices.shape[:-1] + params.shape[indices.shape[-1]:]`.
| Constructors and Destructors |
| --- |
| `[GatherNd](#classtensorflow_1_1ops_1_1_gather_nd_1a83ac49d5f8899faa1cf24f7eea2c01ac)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) params, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_gather_nd_1a3ef794c722311cc2b178e09e32c48f15)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_gather_nd_1a3e99a0c52482bb14c94c1bbf9b507e95)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_gather_nd_1ab32d5802ad22d9fa803952390ca3fce8)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_gather_nd_1ab8601c2824b77c2f890a973ccd8f7212)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_gather_nd_1a7741e14bd7240a514268290545b62223)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### GatherNd
```
GatherNd(
const ::tensorflow::Scope & scope,
::tensorflow::Input params,
::tensorflow::Input indices
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV2 tensorflow::ops::QuantizeAndDequantizeV2
========================================
`#include <array_ops.h>`
Quantizes then dequantizes a tensor.
Summary
-------
This op simulates the precision loss from the quantized forward pass by:
1. Quantizing the tensor to fixed point numbers, which should match the target quantization method when it is used in inference.
2. Dequantizing it back to floating point numbers for the following ops, most likely matmul.
There are different ways to quantize. This version uses only scaling, so 0.0 maps to 0.
From the specified 'num\_bits' in the quantized output type, it determines minimum and maximum representable quantized values.
e.g.
* [-128, 127] for signed, num\_bits = 8, or
* [0, 255] for unsigned, num\_bits = 8.
If range\_given == False, the initial input\_min, input\_max will be determined automatically as the minimum and maximum values in the input tensor, otherwise the specified values of input\_min, input\_max are used.
Note: If the input\_min, input\_max are specified, they do not need to equal the actual minimum and maximum values in the tensor. e.g. in some cases it may be beneficial to specify these values such that the low probability extremes of the input distribution are clipped.
This op determines the maximum scale\_factor that would map the initial [input\_min, input\_max] range to a range that lies within the representable quantized range.
It determines the scale from one of input\_min and input\_max, then updates the other one to maximize the representable range.
e.g.
* if the output is signed, num\_bits = 8, [input\_min, input\_max] = [-10.0, 5.0]: it would use a scale\_factor of -128 / -10.0 = 12.8 In this case, it would update input\_max to be 127 / 12.8 = 9.921875
* if the output is signed, num\_bits = 8, [input\_min, input\_max] = [-10.0, 10.0]: it would use a scale\_factor of 127 / 10.0 = 12.7 In this case, it would update input\_min to be 128.0 / 12.7 = -10.07874
* if the output is unsigned, input\_min is forced to be 0, and only the specified input\_max is used.
After determining the scale\_factor and updating the input range, it applies the following to each value in the 'input' tensor.
output = round(clamp(value, input\_min, input\_max) \* scale\_factor) / scale\_factor.
The above round function rounds the value based on the given round\_mode.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: [Tensor](../tensor#classtensorflow_1_1_tensor) to quantize and then dequantize.
* input\_min: If `range_given == True`, this specifies the minimum input value that needs to be represented, otherwise it is determined from the min value of the `input` tensor.
* input\_max: If `range_given == True`, this specifies the maximum input value that needs to be represented, otherwise it is determined from the max value of the `input` tensor.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)`):
* signed\_input: Whether the quantization is signed or unsigned. (actually this parameter should have been called **`signed_output`** )
* num\_bits: The bitwidth of the quantization.
* range\_given: Whether the range is given or should be determined from the `input` tensor.
* round\_mode: The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. The following rounding modes are currently supported:
* HALF\_TO\_EVEN: this is the default round\_mode.
* HALF\_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 rounds up to -7.
* narrow\_range: If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. i.e. for 8 bit quantization, the minimum value is -127 instead of -128.
* axis: If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[QuantizeAndDequantizeV2](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1ab81e90aeb82c32fee11cbb78ea79256c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max)` |
| `[QuantizeAndDequantizeV2](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1ade188f7f795dcdc942c5fd58f2f8a8e5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, const [QuantizeAndDequantizeV2::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a45c97d3e44ee22144c4069140c62e632)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1afa858ac64f57964cc7e240d15d55c6fc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a4e7f959e8b441d29250865e572a4fbdf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a8b0a60912ec1655d16d0b730ade3d77f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a0a98f344b600678c0e02900e3c65fa1c)() const` | |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a9c18828d69c21c7a0816fa038a625bf7)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a932512af7ba9e8bcd004b7c8a33a39cd)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a028a4ae1324461337591f110899faaa8)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` |
| `[RangeGiven](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1ae9abbe219fcfb58ce5aa286c0aa70210)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` |
| `[RoundMode](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a115965ac1e5e18ea48875771bcfa6ae8)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` |
| `[SignedInput](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1a7bfc7668e202447e7f36df21e7864361)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizeAndDequantizeV2::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v2/attrs) | Optional attribute setters for [QuantizeAndDequantizeV2](quantize-and-dequantize-v2#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizeAndDequantizeV2
```
QuantizeAndDequantizeV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max
)
```
### QuantizeAndDequantizeV2
```
QuantizeAndDequantizeV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max,
const QuantizeAndDequantizeV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
### RangeGiven
```
Attrs RangeGiven(
bool x
)
```
### RoundMode
```
Attrs RoundMode(
StringPiece x
)
```
### SignedInput
```
Attrs SignedInput(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseSlice tensorflow::ops::SparseSlice
============================
`#include <sparse_ops.h>`
Slice a `SparseTensor` based on the `start` and `size`.
Summary
-------
For example, if the input is
```
input_tensor = shape = [2, 7]
[ a d e ]
[b c ]
```
Graphically the output tensors are:
```
sparse_slice([0, 0], [2, 4]) = shape = [2, 4]
[ a ]
[b c ]
sparse_slice([0, 4], [2, 3]) = shape = [2, 3]
[ d e ]
[ ]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: 2-D tensor represents the indices of the sparse tensor.
* values: 1-D tensor represents the values of the sparse tensor.
* shape: 1-D. tensor represents the shape of the sparse tensor.
* start: 1-D. tensor represents the start of the slice.
* size: 1-D. tensor represents the size of the slice. output indices: A list of 1-D tensors represents the indices of the output sparse tensors.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices
* `[Output](../output#classtensorflow_1_1_output)` output\_values: A list of 1-D tensors represents the values of the output sparse tensors.
* `[Output](../output#classtensorflow_1_1_output)` output\_shape: A list of 1-D tensors represents the shape of the output sparse tensors.
| Constructors and Destructors |
| --- |
| `[SparseSlice](#classtensorflow_1_1ops_1_1_sparse_slice_1ae85f2c76a6927e51533cbd7f29023384)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) start, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_slice_1aed4bb735de50f6dd5197a9c1f1e0c495)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_slice_1aaecbd9e39db620d14102a63edfcd268b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_slice_1a9bb1a626ae5c8aba33b1fc1faad36c60)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_slice_1ac1c6b7424ce33a53834c6c362ae8790a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseSlice
```
SparseSlice(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
::tensorflow::Input values,
::tensorflow::Input shape,
::tensorflow::Input start,
::tensorflow::Input size
)
```
tensorflow_cpp tensorflow::ops::ResourceCountUpTo tensorflow::ops::ResourceCountUpTo
==================================
`#include <state_ops.h>`
Increments variable pointed to by 'resource' until it reaches 'limit'.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* resource: Should be from a scalar `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node.
* limit: If incrementing ref would bring it above limit, instead generates an 'OutOfRange' error.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A copy of the input before increment. If nothing else modifies the input, the values produced will all be distinct.
| Constructors and Destructors |
| --- |
| `[ResourceCountUpTo](#classtensorflow_1_1ops_1_1_resource_count_up_to_1a3f5cc785cdb1c38e13b4985cce71d3dc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) resource, int64 limit, DataType T)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_count_up_to_1a8d9322d66a94c1305a62da78483e3a60)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_resource_count_up_to_1a9be0b0c2483021f66711c198b258f00f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_resource_count_up_to_1a8c06d29483d81d8e354a58552bffb5ab)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_resource_count_up_to_1a18b6c3e3062b78ee885173c5eda18122)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_resource_count_up_to_1a29b3486aade8e7ad3dff23cabd39c4be)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ResourceCountUpTo
```
ResourceCountUpTo(
const ::tensorflow::Scope & scope,
::tensorflow::Input resource,
int64 limit,
DataType T
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::IdentityReader tensorflow::ops::IdentityReader
===============================
`#include <io_ops.h>`
A Reader that outputs the queued work as both the key and value.
Summary
-------
To use, enqueue strings in a Queue. [ReaderRead](reader-read#classtensorflow_1_1ops_1_1_reader_read) will take the front work string and output (work, work).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/identity-reader/attrs#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs)`):
* container: If non-empty, this reader is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to reference the Reader.
| Constructors and Destructors |
| --- |
| `[IdentityReader](#classtensorflow_1_1ops_1_1_identity_reader_1a8377a1278a34db6e77c425ff2e9e7ff3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| `[IdentityReader](#classtensorflow_1_1ops_1_1_identity_reader_1af33f0b851d794d0ec80d99c58487d2c2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const [IdentityReader::Attrs](../../../struct/tensorflow/ops/identity-reader/attrs#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_identity_reader_1a7ec93f43074ad744acc98e1d1a733114)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reader\_handle](#classtensorflow_1_1ops_1_1_identity_reader_1a99941351a078c0603e987274e036aaec)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_identity_reader_1aaca21556a5e7953519c4f3bb2e8e586d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_identity_reader_1a040ff71a57aa70dc1302a1a02ca4642f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_identity_reader_1aa542e40b49ddb2813861d60aad258ed7)() const` | |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_identity_reader_1a0143cf6ae20b8eb585dc75f7ca9e1b65)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/identity-reader/attrs#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_identity_reader_1acc58b573c228deef23d4680b1c5fb452)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/identity-reader/attrs#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::IdentityReader::Attrs](../../../struct/tensorflow/ops/identity-reader/attrs) | Optional attribute setters for [IdentityReader](identity-reader#classtensorflow_1_1ops_1_1_identity_reader). |
Public attributes
-----------------
### operation
```
Operation operation
```
### reader\_handle
```
::tensorflow::Output reader_handle
```
Public functions
----------------
### IdentityReader
```
IdentityReader(
const ::tensorflow::Scope & scope
)
```
### IdentityReader
```
IdentityReader(
const ::tensorflow::Scope & scope,
const IdentityReader::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseSegmentMeanGrad tensorflow::ops::SparseSegmentMeanGrad
======================================
`#include <math_ops.h>`
Computes gradients for [SparseSegmentMean](sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean).
Summary
-------
Returns tensor "output" with same shape as grad, except for dimension 0 whose value is output\_dim0.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* grad: gradient propagated to the [SparseSegmentMean](sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean) op.
* indices: indices passed to the corresponding [SparseSegmentMean](sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean) op.
* segment\_ids: segment\_ids passed to the corresponding [SparseSegmentMean](sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean) op.
* output\_dim0: dimension 0 of "data" passed to [SparseSegmentMean](sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean) op.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[SparseSegmentMeanGrad](#classtensorflow_1_1ops_1_1_sparse_segment_mean_grad_1a724e6fb571c6a87201d2ebaedea31c75)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) output_dim0)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_mean_grad_1a1b19a2a8b235c50a0b0ee9083e403840)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_mean_grad_1a613157f9b34acb9b3716eaf9a236c0ae)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_mean_grad_1ad41fa0ddb89eea23700617f29726a908)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_mean_grad_1a1845b498b15b73eadeb3d0f616238363)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_mean_grad_1a7b68a6f6710687a2e2a2bcc5c6976bed)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentMeanGrad
```
SparseSegmentMeanGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input segment_ids,
::tensorflow::Input output_dim0
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::MaxPoolGradGradWithArgmax tensorflow::ops::MaxPoolGradGradWithArgmax
==========================================
`#include <nn_ops.h>`
Computes second-order gradients of the maxpooling function.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The original input.
* grad: 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the input of `max_pool`.
* argmax: The indices of the maximum values chosen for each output of `max_pool`.
* ksize: The size of the window for each dimension of the input tensor.
* strides: The stride of the sliding window for each dimension of the input tensor.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1_1_attrs)`):
* include\_batch\_in\_index: Whether to include batch dimension in flattened index of `argmax`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Gradients of gradients w.r.t. the input of `max_pool`.
| Constructors and Destructors |
| --- |
| `[MaxPoolGradGradWithArgmax](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1a593b2e655426fc2115b078b9fa3d58c9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) argmax, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[MaxPoolGradGradWithArgmax](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1ae16cefddf3e2d1bc07b1be0a310d0f5f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) argmax, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [MaxPoolGradGradWithArgmax::Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1ad7651c4aa8ab3970d854e03fea44b931)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1a1df14c4bce71fd9dc7d6011430a93483)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1a4fab108da33b0eca234b7b8476eadc8a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1a1c878b05b1f1c50d0ac8b18bd8dabe5c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1a8de5ba5ff913d7e716975d514f3a398a)() const` | |
| Public static functions |
| --- |
| `[IncludeBatchInIndex](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1a08b144b554cd408cdae86515c196fbf0)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-with-argmax/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPoolGradGradWithArgmax::Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-with-argmax/attrs) | Optional attribute setters for [MaxPoolGradGradWithArgmax](max-pool-grad-grad-with-argmax#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPoolGradGradWithArgmax
```
MaxPoolGradGradWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input grad,
::tensorflow::Input argmax,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### MaxPoolGradGradWithArgmax
```
MaxPoolGradGradWithArgmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input grad,
::tensorflow::Input argmax,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const MaxPoolGradGradWithArgmax::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### IncludeBatchInIndex
```
Attrs IncludeBatchInIndex(
bool x
)
```
tensorflow_cpp tensorflow::ops::DecodeCSV tensorflow::ops::DecodeCSV
==========================
`#include <parsing_ops.h>`
Convert CSV records to tensors.
Summary
-------
Each column maps to one tensor.
RFC 4180 format is expected for the CSV records. (<https://tools.ietf.org/html/rfc4180>) Note that we allow leading and trailing spaces with int or float field.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* records: Each string is a record/row in the csv and all records should have the same format.
* record\_defaults: One tensor per column of the input record, with either a scalar default value for that column or an empty vector if the column is required.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)`):
* field\_delim: char delimiter to separate fields in a record.
* use\_quote\_delim: If false, treats double quotation marks as regular characters inside of the string fields (ignoring RFC 4180, Section 2, Bullet 5).
* na\_value: Additional string to recognize as NA/NaN.
Returns:
* `OutputList`: Each tensor will have the same shape as records.
| Constructors and Destructors |
| --- |
| `[DecodeCSV](#classtensorflow_1_1ops_1_1_decode_c_s_v_1abb564f0f8635299e4d247579c3573a82)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) records, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) record_defaults)` |
| `[DecodeCSV](#classtensorflow_1_1ops_1_1_decode_c_s_v_1ae32db75a692e4afe6b70cc30598e4011)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) records, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) record_defaults, const [DecodeCSV::Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a724a3cdf473b012d0b0ba7d76671ef50)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_decode_c_s_v_1af13fac27cc90a9988b6f3130be188b14)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_decode_c_s_v_1aba6179f5920348d20cc574fa0921ae82)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[FieldDelim](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a783b3fcdf01d0b499e1a5f72a5b042a2)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` |
| `[NaValue](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a357f7eec9a91b48588facfab257e46a5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` |
| `[SelectCols](#classtensorflow_1_1ops_1_1_decode_c_s_v_1a08cc36204d26ff6e6cd736a7d4a1e43b)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` |
| `[UseQuoteDelim](#classtensorflow_1_1ops_1_1_decode_c_s_v_1aa67991c469762771d5aa77050b8808a3)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::DecodeCSV::Attrs](../../../struct/tensorflow/ops/decode-c-s-v/attrs) | Optional attribute setters for [DecodeCSV](decode-c-s-v#classtensorflow_1_1ops_1_1_decode_c_s_v). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::OutputList output
```
Public functions
----------------
### DecodeCSV
```
DecodeCSV(
const ::tensorflow::Scope & scope,
::tensorflow::Input records,
::tensorflow::InputList record_defaults
)
```
### DecodeCSV
```
DecodeCSV(
const ::tensorflow::Scope & scope,
::tensorflow::Input records,
::tensorflow::InputList record_defaults,
const DecodeCSV::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### FieldDelim
```
Attrs FieldDelim(
StringPiece x
)
```
### NaValue
```
Attrs NaValue(
StringPiece x
)
```
### SelectCols
```
Attrs SelectCols(
const gtl::ArraySlice< int > & x
)
```
### UseQuoteDelim
```
Attrs UseQuoteDelim(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ReaderReset tensorflow::ops::ReaderReset
============================
`#include <io_ops.h>`
[Restore](restore#classtensorflow_1_1ops_1_1_restore) a Reader to its initial clean state.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a Reader.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ReaderReset](#classtensorflow_1_1ops_1_1_reader_reset_1ad2198afd8978bc0318afc323427c240e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reader_reset_1a1179fc3c2cd3b5839a9145ad7a08c005)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_reader_reset_1a4a258a3bbb0bcc6aa197a42346375293)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ReaderReset
```
ReaderReset(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::AllCandidateSampler tensorflow::ops::AllCandidateSampler
====================================
`#include <candidate_sampling_ops.h>`
Generates labels for candidate sampling with a learned unigram distribution.
Summary
-------
See explanations of candidate sampling and the data formats at go/candidate-sampling.
For each batch, this op picks a single set of sampled candidate labels.
The advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* true\_classes: A batch\_size \* num\_true matrix, in which each row contains the IDs of the num\_true target\_classes in the corresponding original label.
* num\_true: Number of true labels per context.
* num\_sampled: Number of candidates to produce.
* unique: If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/all-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs)`):
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sampled\_candidates: A vector of length num\_sampled, in which each element is the ID of a sampled candidate.
* `[Output](../output#classtensorflow_1_1_output)` true\_expected\_count: A batch\_size \* num\_true matrix, representing the number of times each candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
* `[Output](../output#classtensorflow_1_1_output)` sampled\_expected\_count: A vector of length num\_sampled, for each sampled candidate representing the number of times the candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
| Constructors and Destructors |
| --- |
| `[AllCandidateSampler](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1aad2d9e73a8fc9a50a37699e20ebffa6a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique)` |
| `[AllCandidateSampler](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1ad1521c027811f7f0e056b87d12071a4e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, const [AllCandidateSampler::Attrs](../../../struct/tensorflow/ops/all-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1a7cec3217c7f1b8bd521a0f7b8e1b93ff)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sampled\_candidates](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1a47ac61dc358107667c422fccbdd3418d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sampled\_expected\_count](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1a53a987bbc8c5b035948259ba9c90aa20)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[true\_expected\_count](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1ac46a1428d3dc734892084c568c632d09)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1a4ab278d6ad3303f8d03b47ce43637cf5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/all-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_all_candidate_sampler_1a412dc3eb4a931969a4cd51ca7837131f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/all-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AllCandidateSampler::Attrs](../../../struct/tensorflow/ops/all-candidate-sampler/attrs) | Optional attribute setters for [AllCandidateSampler](all-candidate-sampler#classtensorflow_1_1ops_1_1_all_candidate_sampler). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sampled\_candidates
```
::tensorflow::Output sampled_candidates
```
### sampled\_expected\_count
```
::tensorflow::Output sampled_expected_count
```
### true\_expected\_count
```
::tensorflow::Output true_expected_count
```
Public functions
----------------
### AllCandidateSampler
```
AllCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique
)
```
### AllCandidateSampler
```
AllCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
const AllCandidateSampler::Attrs & attrs
)
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ApplyCenteredRMSProp tensorflow::ops::ApplyCenteredRMSProp
=====================================
`#include <training_ops.h>`
Update '\*var' according to the centered RMSProp algorithm.
Summary
-------
The centered RMSProp algorithm uses an estimate of the centered second moment (i.e., the variance) for normalization, as opposed to regular RMSProp, which uses the (uncentered) second moment. This often helps with training, but is slightly more expensive in terms of computation and memory.
Note that in dense implementation of this algorithm, mg, ms, and mom will update even if the grad is zero, but in this sparse implementation, mg, ms, and mom will not update in iterations during which the grad is zero.
mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 mean\_grad = decay \* mean\_grad + (1-decay) \* gradient
Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon - mean\_grad \*\* 2)
mg <- rho \* mg\_{t-1} + (1-rho) \* grad ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms - mg \* mg + epsilon) var <- var - mom
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* mg: Should be from a Variable().
* ms: Should be from a Variable().
* mom: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay rate. Must be a scalar.
* momentum: Momentum Scale. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1a4bd3dd81dc6d1695c9ad5728462dd8cd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyCenteredRMSProp](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1a632653cb819d859518dab8ceb0e7601c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mg, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1a1eed55db035d88dc72301a9da4440e4a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1a62975e9d2166f002e315def153375125)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1aa871631223879c0e00dc1ad75118f3ad)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1a9c793c604a2790930231f4244e7118cb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1a5506a3056061103ac1e9a7a48412a968)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1ace802790fc34b37dc6b7574ea6f55cea)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-centered-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyCenteredRMSProp::Attrs](../../../struct/tensorflow/ops/apply-centered-r-m-s-prop/attrs) | Optional attribute setters for [ApplyCenteredRMSProp](apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyCenteredRMSProp
```
ApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ApplyCenteredRMSProp
```
ApplyCenteredRMSProp(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input mg,
::tensorflow::Input ms,
::tensorflow::Input mom,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input momentum,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ApplyCenteredRMSProp::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::BroadcastTo tensorflow::ops::BroadcastTo
============================
`#include <array_ops.h>`
Broadcast an array for a compatible shape.
Summary
-------
Broadcasting is the process of making arrays to have compatible shapes for arithmetic operations. Two shapes are compatible if for each dimension pair they are either equal or one of them is one. When trying to broadcast a [Tensor](../tensor#classtensorflow_1_1_tensor) to a shape, it starts with the trailing dimensions, and works its way forward.
For example,
x = tf.constant([1, 2, 3]) y = tf.broadcast\_to(x, [3, 3]) print(y) tf.Tensor( [[1 2 3] [1 2 3] [1 2 3]], shape=(3, 3), dtype=int32)
In the above example, the input [Tensor](../tensor#classtensorflow_1_1_tensor) with the shape of `[1, 3]` is broadcasted to output [Tensor](../tensor#classtensorflow_1_1_tensor) with shape of `[3, 3]`.
When doing broadcasted operations such as multiplying a tensor by a scalar, broadcasting (usually) confers some time or space benefit, as the broadcasted tensor is never materialized.
However, `broadcast_to` does not carry with it any such benefits. The newly-created tensor takes the full memory of the broadcasted shape. (In a graph context, `broadcast_to` might be fused to subsequent operation and then be optimized away, however.)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A [Tensor](../tensor#classtensorflow_1_1_tensor) to broadcast.
* shape: An 1-D `int`[Tensor](../tensor#classtensorflow_1_1_tensor). The shape of the desired output.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor).
| Constructors and Destructors |
| --- |
| `[BroadcastTo](#classtensorflow_1_1ops_1_1_broadcast_to_1a37bf1f8b63e588def9b3805017209ee6)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_broadcast_to_1abb152ff71cda1cf3af84a7c656faac03)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_broadcast_to_1aaa451e1fc17fe438aa744a2880efca62)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_broadcast_to_1a2c429236acfd549d2252190a63a446f0)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_broadcast_to_1a21be2705c2eba98f1cf7560295561b58)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_broadcast_to_1a43222f4482f5ccb868548380633ce7f5)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BroadcastTo
```
BroadcastTo(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input shape
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApplyProximalGradientDescent tensorflow::ops::ApplyProximalGradientDescent
=============================================
`#include <training_ops.h>`
Update '\*var' as FOBOS algorithm with fixed learning rate.
Summary
-------
prox\_v = var - alpha \* delta var = sign(prox\_v)/(1+alpha\*l2) \* max{|prox\_v|-alpha\*l1,0}
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* alpha: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* delta: The change.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1_1_attrs)`):
* use\_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a577feb7c1010835d2021ec6438a03e18)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta)` |
| `[ApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a72d2634c5478ad4b4713e1ad81a789f9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta, const [ApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1aa55ca8817e188f7a4e6191b47239f67e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a5c78a54b7a97b4031240bd2b4f21e747)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a8e7c76bc6bc033a17176899023e215fd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a1dfd24a06a5604ba3f0b372fc9936a3f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a9e54dc150d7c007fbef0bff785608acf)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1a09a254600f5323028ef7d0f93ec99bab)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/apply-proximal-gradient-descent/attrs) | Optional attribute setters for [ApplyProximalGradientDescent](apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyProximalGradientDescent
```
ApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input delta
)
```
### ApplyProximalGradientDescent
```
ApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input delta,
const ApplyProximalGradientDescent::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Mod tensorflow::ops::Mod
====================
`#include <math_ops.h>`
Returns element-wise remainder of division.
Summary
-------
This emulates C semantics in that
the result here is consistent with a truncating divide. E.g. `tf.truncatediv(x, y) * y + truncate_mod(x, y) = x`.
*NOTE*: `[Mod](mod#classtensorflow_1_1ops_1_1_mod)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Mod](#classtensorflow_1_1ops_1_1_mod_1a27b100e6a9d70861739b08fc2a2634fc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_mod_1a6e86557c11351c2e6edf90ac28e0eb98)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_mod_1a56c898e2535e3db1376a4ef0540968ec)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_mod_1a1e04be7c4e0c388e1bbf2c9ac98b5bcf)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mod_1a258d8a1e6ba4f9eb68318ce6589db69e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mod_1abd1ac656294ef54a21785384b04fe097)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Mod
```
Mod(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseDenseCwiseDiv tensorflow::ops::SparseDenseCwiseDiv
====================================
`#include <sparse_ops.h>`
Component-wise divides a SparseTensor by a dense [Tensor](../tensor#classtensorflow_1_1_tensor).
Summary
-------
*Limitation*: this Op only broadcasts the dense side to the sparse side, but not the other direction.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sp\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* sp\_values: 1-D. `N` non-empty values corresponding to `sp_indices`.
* sp\_shape: 1-D. Shape of the input SparseTensor.
* dense: `R`-D. The dense [Tensor](../tensor#classtensorflow_1_1_tensor) operand.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D. The `N` values that are operated on.
| Constructors and Destructors |
| --- |
| `[SparseDenseCwiseDiv](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_div_1a87549e8e7519c57e6c323d4701faeeab)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_div_1a0128b8d311966a833d29807fbeffccf9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_div_1a1eb4aa87753ed0173a7a7660dde1e88e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_div_1a4c009ae887fb5d07d2723d00ca720ec5)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_div_1af20b843f9a01bf06667de6d99e6262c6)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_div_1ab746f2df62c2fb2eb54ff05ec9de32e7)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseDenseCwiseDiv
```
SparseDenseCwiseDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input sp_indices,
::tensorflow::Input sp_values,
::tensorflow::Input sp_shape,
::tensorflow::Input dense
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RandomGamma tensorflow::ops::RandomGamma
============================
`#include <random_ops.h>`
Outputs random values from the Gamma distribution(s) described by alpha.
Summary
-------
This op uses the algorithm by Marsaglia et al. to acquire samples via transformation-rejection from pairs of uniform and normal random variables. See <http://dl.acm.org/citation.cfm?id=358414>
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: 1-D integer tensor. Shape of independent samples to draw from each distribution described by the shape parameters given in alpha.
* alpha: A tensor in which each scalar is a "shape" parameter describing the associated gamma distribution.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-gamma/attrs#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor with shape `shape + shape(alpha)`. Each slice `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for `alpha[i0, i1, ...iN]`. The dtype of the output matches the dtype of alpha.
| Constructors and Destructors |
| --- |
| `[RandomGamma](#classtensorflow_1_1ops_1_1_random_gamma_1a54b3819de158eaa8e1f4dd2e09c38350)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha)` |
| `[RandomGamma](#classtensorflow_1_1ops_1_1_random_gamma_1afb5a4dcc9f3b7849c9ccf8e49233c658)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, const [RandomGamma::Attrs](../../../struct/tensorflow/ops/random-gamma/attrs#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_random_gamma_1a3442325c98888cd41398f85c8dc7215d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_random_gamma_1ae108904c41339fe8cced748589ef2622)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_gamma_1a0a8429580ed9eda5d1b850c9fc9cd7c6)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_gamma_1ad5e60091b7438c54f6d2457fccba06ed)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_gamma_1a20b55a813e49ae84f48cd79c87285409)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_random_gamma_1a62800c601cb18e766b0f41f18f86f335)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-gamma/attrs#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_gamma_1a42984b9ff3911c8867903be5bcd97ac7)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-gamma/attrs#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomGamma::Attrs](../../../struct/tensorflow/ops/random-gamma/attrs) | Optional attribute setters for [RandomGamma](random-gamma#classtensorflow_1_1ops_1_1_random_gamma). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RandomGamma
```
RandomGamma(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input alpha
)
```
### RandomGamma
```
RandomGamma(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input alpha,
const RandomGamma::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyAdadelta tensorflow::ops::ResourceApplyAdadelta
======================================
`#include <training_ops.h>`
Update '\*var' according to the adadelta scheme.
Summary
-------
accum = rho() \* accum + (1 - rho()) \* grad.square(); update = (update\_accum + epsilon).sqrt() \* (accum + epsilon()).rsqrt() \* grad; update\_accum = rho() \* update\_accum + (1 - rho()) \* update.square(); var -= update;
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* accum\_update: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* rho: Decay factor. Must be a scalar.
* epsilon: Constant factor. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_resource_apply_adadelta_1_1_attrs)`):
* use\_locking: If True, updating of the var, accum and update\_accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyAdadelta](#classtensorflow_1_1ops_1_1_resource_apply_adadelta_1a4f85dc7a030d3e04af02dbcbb59ce1a9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyAdadelta](#classtensorflow_1_1ops_1_1_resource_apply_adadelta_1a883cc46b972fbf81192d699ee52def56)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyAdadelta::Attrs](../../../struct/tensorflow/ops/resource-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_resource_apply_adadelta_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_adadelta_1a4dd0008d30f0e32e1221225a4be2a2f2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_adadelta_1ac80f2bfde898d7a7c247161e484d603f)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_adadelta_1afbd53a1956a5e15a96e9872d680893fc)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_resource_apply_adadelta_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyAdadelta::Attrs](../../../struct/tensorflow/ops/resource-apply-adadelta/attrs) | Optional attribute setters for [ResourceApplyAdadelta](resource-apply-adadelta#classtensorflow_1_1ops_1_1_resource_apply_adadelta). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyAdadelta
```
ResourceApplyAdadelta(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input accum_update,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ResourceApplyAdadelta
```
ResourceApplyAdadelta(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input accum_update,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ResourceApplyAdadelta::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Bucketize tensorflow::ops::Bucketize
==========================
`#include <math_ops.h>`
Bucketizes 'input' based on 'boundaries'.
Summary
-------
For example, if the inputs are boundaries = [0, 10, 100] input = [[-5, 10000] [150, 10] [5, 100]]
then the output will be output = [[0, 3] [3, 2] [1, 3]]
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: [Any](any#classtensorflow_1_1ops_1_1_any) shape of [Tensor](../tensor#classtensorflow_1_1_tensor) contains with int or float type.
* boundaries: A sorted list of floats gives the boundary of the buckets.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same shape with 'input', each value of input replaced with bucket index.
(numpy) Equivalent to np.digitize.
| Constructors and Destructors |
| --- |
| `[Bucketize](#classtensorflow_1_1ops_1_1_bucketize_1a104987760896f84594d21a17738a6fe1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< float > & boundaries)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_bucketize_1a11d9d7e39578db3e3dfaf2ef9213ae34)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_bucketize_1aa111bb19d459f3f26ae8f03297739125)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_bucketize_1af82e929e268a0301d7ce4c41480a19e4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bucketize_1a7d66691237f8de46ab0c52782419cf53)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bucketize_1aa3f697a162b180d9aa7847cb7d22dc3e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Bucketize
```
Bucketize(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const gtl::ArraySlice< float > & boundaries
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FusedBatchNorm tensorflow::ops::FusedBatchNorm
===============================
`#include <nn_ops.h>`
Batch normalization.
Summary
-------
Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for input data.
* scale: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.
* offset: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for offset, to shift to the normalized x.
* mean: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for population mean. Used for inference only; must be empty for training.
* variance: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for population variance. Used for inference only; must be empty for training.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)`):
* epsilon: A small float number added to the variance of x.
* data\_format: The data format for x and y. Either "NHWC" (default) or "NCHW".
* is\_training: A bool value to indicate the operation is for training (default) or inference.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` y: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for output data.
* `[Output](../output#classtensorflow_1_1_output)` batch\_mean: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be used by TensorFlow to compute the running mean.
* `[Output](../output#classtensorflow_1_1_output)` batch\_variance: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance, to be used by TensorFlow to compute the running variance.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_1: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean, to be reused in the gradient computation.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_2: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case), to be reused in the gradient computation.
| Constructors and Destructors |
| --- |
| `[FusedBatchNorm](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a69c179b344cda5895eb3483fb7448928)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offset, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mean, ::[tensorflow::Input](../input#classtensorflow_1_1_input) variance)` |
| `[FusedBatchNorm](#classtensorflow_1_1ops_1_1_fused_batch_norm_1af4af8407dca8fff3c164daa4c2f6a827)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) offset, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mean, ::[tensorflow::Input](../input#classtensorflow_1_1_input) variance, const [FusedBatchNorm::Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[batch\_mean](#classtensorflow_1_1ops_1_1_fused_batch_norm_1af8a5a9177a16c78954e28294cc5df54b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[batch\_variance](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a699f25d6a78f4be2daa89eed8be158fa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_1ad685771a3e631d8df2ad7efdbc6ba522)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reserve\_space\_1](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a8d5f73afcfa418b1dd3f8c9bf586365f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_2](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a3f7515925a361980789e76ea3a5bfea3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[y](#classtensorflow_1_1ops_1_1_fused_batch_norm_1aa3cdf2e86ba7283cd1b046beee6d04b9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a609451fcc6f8fa94a6b11137d5db9264)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` |
| `[Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_1ac732e3d3d1e1c4ed404daf2820324b34)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` |
| `[ExponentialAvgFactor](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a8bf8934ee30b040f02d177c6b7a8480a)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` |
| `[IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_1a89f98ad4ef79d386a2bf3d64d024f624)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedBatchNorm::Attrs](../../../struct/tensorflow/ops/fused-batch-norm/attrs) | Optional attribute setters for [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm). |
Public attributes
-----------------
### batch\_mean
```
::tensorflow::Output batch_mean
```
### batch\_variance
```
::tensorflow::Output batch_variance
```
### operation
```
Operation operation
```
### reserve\_space\_1
```
::tensorflow::Output reserve_space_1
```
### reserve\_space\_2
```
::tensorflow::Output reserve_space_2
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### FusedBatchNorm
```
FusedBatchNorm(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input offset,
::tensorflow::Input mean,
::tensorflow::Input variance
)
```
### FusedBatchNorm
```
FusedBatchNorm(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input offset,
::tensorflow::Input mean,
::tensorflow::Input variance,
const FusedBatchNorm::Attrs & attrs
)
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Epsilon
```
Attrs Epsilon(
float x
)
```
### ExponentialAvgFactor
```
Attrs ExponentialAvgFactor(
float x
)
```
### IsTraining
```
Attrs IsTraining(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::AddN tensorflow::ops::AddN
=====================
`#include <math_ops.h>`
[Add](add#classtensorflow_1_1ops_1_1_add) all input tensors element wise.
Summary
-------
Inputs must be of same size and shape.
```
x = [9, 7, 10]
tf.math.add_n(x) ==> 26
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The sum tensor.
| Constructors and Destructors |
| --- |
| `[AddN](#classtensorflow_1_1ops_1_1_add_n_1a4deb1509689964000fe0ba7f9e6cc389)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_add_n_1a6b5c41c59d7668a8daa548dc97c3dc29)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sum](#classtensorflow_1_1ops_1_1_add_n_1ad45f4b4b33007f7bbe3d87cfdee5550f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_add_n_1a6d9d07e9f1a37f6dfa533fab704c6962)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_n_1af8279db594037317319083a18ad2173e)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_n_1a601981a899a6788c21d9b3abdbb5cca8)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### sum
```
::tensorflow::Output sum
```
Public functions
----------------
### AddN
```
AddN(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::PrintV2 tensorflow::ops::PrintV2
========================
`#include <logging_ops.h>`
Prints a string scalar.
Summary
-------
Prints a string scalar to the desired output\_stream.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The string scalar to print.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/print-v2/attrs#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs)`):
* output\_stream: A string specifying the output stream or logging level to print to.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[PrintV2](#classtensorflow_1_1ops_1_1_print_v2_1a393f67a5391f338d8e3fc19569ba4459)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| `[PrintV2](#classtensorflow_1_1ops_1_1_print_v2_1ad9ecc820cf2a86447d7ddd6b25d9a8bd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [PrintV2::Attrs](../../../struct/tensorflow/ops/print-v2/attrs#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_print_v2_1a9a1413e54679233c6d74b835e575f5da)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_print_v2_1afa90ca91f2d7ecab65f37d5a94dac85b)() const` | |
| Public static functions |
| --- |
| `[End](#classtensorflow_1_1ops_1_1_print_v2_1a2d4c2e84f84215b9d18cc46c7806d5a5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/print-v2/attrs#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs)` |
| `[OutputStream](#classtensorflow_1_1ops_1_1_print_v2_1ab139b92d03800230ff3f84b1395ae0af)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/print-v2/attrs#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::PrintV2::Attrs](../../../struct/tensorflow/ops/print-v2/attrs) | Optional attribute setters for [PrintV2](print-v2#classtensorflow_1_1ops_1_1_print_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### PrintV2
```
PrintV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### PrintV2
```
PrintV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
const PrintV2::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### End
```
Attrs End(
StringPiece x
)
```
### OutputStream
```
Attrs OutputStream(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SegmentMean tensorflow::ops::SegmentMean
============================
`#include <math_ops.h>`
Computes the mean along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Computes a tensor such that \(output\_i = \frac{\sum\_j data\_j}{N}\) where `mean` is over `j` such that `segment_ids[j] == i` and `N` is the total number of values summed.
If the mean is empty for a given segment ID `i`, `output[i] = 0`.
Caution: On CPU, values in `segment_ids` are always validated to be sorted, and an error is thrown for indices that are not increasing. On GPU, this does not throw an error for unsorted indices. On GPU, out-of-order indices result in safe but unspecified behavior, which may include treating out-of-order indices as a smaller following index when computing the numerator of the mean.

For example:
c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.math.segment\_mean(c, tf.constant([0, 0, 1])).numpy() array([[2.5, 2.5, 2.5, 2.5], [5., 6., 7., 8.]], dtype=float32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A 1-D tensor whose size is equal to the size of `data`'s first dimension. Values should be sorted and can be repeated.
Caution: The values are always validated to be sorted on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SegmentMean](#classtensorflow_1_1ops_1_1_segment_mean_1a9fc798114162e49ca1a2e3be55c67c4e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_segment_mean_1ab33c7bc6ed3ae2192796a60aa4e2603d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_segment_mean_1a64036d8ee48b0555a734f063c8b5e21e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_segment_mean_1a9a1dd3986731336496132e50f5882bfd)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_segment_mean_1a4555ae396508ae3dd5a91c67b3f7d8f4)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_segment_mean_1a5a63b16dc3408efa63a3d07570c08783)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SegmentMean
```
SegmentMean(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::TensorArrayGrad tensorflow::ops::TensorArrayGrad
================================
`#include <data_flow_ops.h>`
Creates a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) for storing the gradients of values in the given handle.
Summary
-------
If the given [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) gradient already exists, returns a reference to it.
Locks the size of the original [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) by disabling its dynamic size flag.
**A note about the input flow\_in:**
The handle flow\_in forces the execution of the gradient lookup to occur only after certain other operations have occurred. For example, when the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) is dynamically sized, writes to this [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) may resize the object. The gradient [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) is statically sized based on the size of the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) when this operation executes. Furthermore, the size of the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) is frozen by this call. As a result, the flow is used to ensure that the call to generate the gradient [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) only happens after all writes are executed.
In the case of dynamically sized TensorArrays, gradient computation should only be performed on read operations that have themselves been chained via flow to occur only after all writes have executed. That way the final size of the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) is known when this operation is called.
**A note about the source attribute:**
[TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) gradient calls use an accumulator [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) object. If multiple gradients are calculated and run in the same session, the multiple gradient nodes may accidentally flow through the same accumulator [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array). This double counts and generally breaks the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) gradient flow.
The solution is to identify which gradient call this particular [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) gradient is being called in. This is performed by identifying a unique string (e.g. "gradients", "gradients\_1", ...) from the input gradient [Tensor](../tensor#classtensorflow_1_1_tensor)'s name. This string is used as a suffix when creating the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) gradient object here (the attribute `source`).
The attribute `source` is added as a suffix to the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array)'s name when performing the creation / lookup, so that each separate gradient calculation gets its own [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) accumulator.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to the forward [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* flow\_in: A float scalar that enforces proper chaining of operations.
* source: The gradient source string, used to decide which gradient [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) to return.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` grad\_handle
* `[Output](../output#classtensorflow_1_1_output)` flow\_out
| Constructors and Destructors |
| --- |
| `[TensorArrayGrad](#classtensorflow_1_1ops_1_1_tensor_array_grad_1a6240f50f9c7efdcf3bf8d48c4218d27b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, StringPiece source)` |
| Public attributes |
| --- |
| `[flow\_out](#classtensorflow_1_1ops_1_1_tensor_array_grad_1a2499ef8bb9c633df24389a51f37654da)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[grad\_handle](#classtensorflow_1_1ops_1_1_tensor_array_grad_1ab5be040d777eb52f767d58a83a3a345d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_grad_1ae7c0b0022fc4a44d321bf759c55413c2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### flow\_out
```
::tensorflow::Output flow_out
```
### grad\_handle
```
::tensorflow::Output grad_handle
```
### operation
```
Operation operation
```
Public functions
----------------
### TensorArrayGrad
```
TensorArrayGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input flow_in,
StringPiece source
)
```
tensorflow_cpp tensorflow::ops::AccumulatorApplyGradient tensorflow::ops::AccumulatorApplyGradient
=========================================
`#include <data_flow_ops.h>`
Applies a gradient to a given accumulator.
Summary
-------
Does not add if local\_step is lesser than the accumulator's global\_step.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a accumulator.
* local\_step: The local\_step value at which the gradient was computed.
* gradient: A tensor of the gradient to be accumulated.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[AccumulatorApplyGradient](#classtensorflow_1_1ops_1_1_accumulator_apply_gradient_1a177bc2345d06d8be4344ceb0ec33fcc5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) local_step, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_accumulator_apply_gradient_1a9c638e54d2c66a66671f0b83a4e2e02e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_accumulator_apply_gradient_1ab611049c1d39230c4afa89d80dbddb57)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### AccumulatorApplyGradient
```
AccumulatorApplyGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input local_step,
::tensorflow::Input gradient
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::OrderedMapIncompleteSize tensorflow::ops::OrderedMapIncompleteSize
=========================================
`#include <data_flow_ops.h>`
Op returns the number of incomplete elements in the underlying container.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The size tensor.
| Constructors and Destructors |
| --- |
| `[OrderedMapIncompleteSize](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a7a3af62e21825508cd186868b105312f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` |
| `[OrderedMapIncompleteSize](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a9a790f692344a5eee13a42c9456e4487)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [OrderedMapIncompleteSize::Attrs](../../../struct/tensorflow/ops/ordered-map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a04d890acc3bde8e645398d005a102ae1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[size](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a3fc3f8692a7f4fb3c25d2f22052bc841)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a1cf230d9ba674f5e2e8da6694c12c3d0)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a05e549915568fcbc8a07cafcb1fd313c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a9d8c2aad0ed4790057aada2797a6d8ba)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a6ea4e5b510a89443bd93f19079880288)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1ab2545e137eab2fe61a3deeaa20a4cc8b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a9242c62f3c556a4de3d6736d1c894e0e)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1a647168bb49d9f020d6810fffa627086a)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-incomplete-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OrderedMapIncompleteSize::Attrs](../../../struct/tensorflow/ops/ordered-map-incomplete-size/attrs) | Optional attribute setters for [OrderedMapIncompleteSize](ordered-map-incomplete-size#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size). |
Public attributes
-----------------
### operation
```
Operation operation
```
### size
```
::tensorflow::Output size
```
Public functions
----------------
### OrderedMapIncompleteSize
```
OrderedMapIncompleteSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes
)
```
### OrderedMapIncompleteSize
```
OrderedMapIncompleteSize(
const ::tensorflow::Scope & scope,
const DataTypeSlice & dtypes,
const OrderedMapIncompleteSize::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ApplyAdagrad tensorflow::ops::ApplyAdagrad
=============================
`#include <training_ops.h>`
Update '\*var' according to the adagrad scheme.
Summary
-------
accum += grad \* grad var -= lr \* grad \* (1 / sqrt(accum))
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyAdagrad](#classtensorflow_1_1ops_1_1_apply_adagrad_1a119cb4675749a5746ce8598f8793a671)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyAdagrad](#classtensorflow_1_1ops_1_1_apply_adagrad_1a251be3569dad2f58e5820e423d32f28c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyAdagrad::Attrs](../../../struct/tensorflow/ops/apply-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_adagrad_1a7e34dfd358db60a1c864ec24b278de1e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_adagrad_1a3fe05f28ae9aa48b8351a53fc562e03d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_adagrad_1ac3e8e9b94978a64092adee8ae4836249)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_adagrad_1a881551beab3939a976b1a859acc77e89)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_adagrad_1a97a0d1b59f2d6bf45ed2281809bfba96)() const` | |
| Public static functions |
| --- |
| `[UpdateSlots](#classtensorflow_1_1ops_1_1_apply_adagrad_1aebe5e4875477a6e8f3634d4c5c33dba0)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_adagrad_1a412d43f4d6cbb6c10d0e49edf9f256f2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyAdagrad::Attrs](../../../struct/tensorflow/ops/apply-adagrad/attrs) | Optional attribute setters for [ApplyAdagrad](apply-adagrad#classtensorflow_1_1ops_1_1_apply_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyAdagrad
```
ApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad
)
```
### ApplyAdagrad
```
ApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
const ApplyAdagrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UpdateSlots
```
Attrs UpdateSlots(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::FusedBatchNormGradV3 tensorflow::ops::FusedBatchNormGradV3
=====================================
`#include <nn_ops.h>`
Gradient for batch normalization.
Summary
-------
Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* y\_backprop: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to y.
* x: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for input data.
* scale: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.
* reserve\_space\_1: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean to be reused in gradient computation. When is\_training is False, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the population mean to be reused in both 1st and 2nd order gradient computation.
* reserve\_space\_2: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case) to be reused in gradient computation. When is\_training is False, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the population variance to be reused in both 1st and 2nd order gradient computation.
* reserve\_space\_3: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for some intermediate results to be reused in gradient computation. When is\_training is False, a dummy empty [Tensor](../tensor#classtensorflow_1_1_tensor) will be created.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)`):
* epsilon: A small float number added to the variance of x.
* data\_format: The data format for y\_backprop, x, x\_backprop. Either "NHWC" (default) or "NCHW".
* is\_training: A bool value to indicate the operation is for training (default) or inference.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` x\_backprop: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to x.
* `[Output](../output#classtensorflow_1_1_output)` scale\_backprop: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to scale.
* `[Output](../output#classtensorflow_1_1_output)` offset\_backprop: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to offset.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_4: Unused placeholder to match the mean input in [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm).
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_5: Unused placeholder to match the variance input in [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm).
| Constructors and Destructors |
| --- |
| `[FusedBatchNormGradV3](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1ac3fe4a0302b06ae9a5cf662f80907528)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y_backprop, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_3)` |
| `[FusedBatchNormGradV3](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1a318c29205a83585cd6e0a6d93454d75d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y_backprop, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_3, const [FusedBatchNormGradV3::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[offset\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1aeabda03fd72ca8bc9ddf3c63a61f3924)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1ac20c169cf4ebb928d29a513c7dbb175d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reserve\_space\_4](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1a72868fdf04f88195ea726226b3560f09)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_5](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1acf0982cbf448b711df128b277e698347)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[scale\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1a1265e887fcbdc24cdea70b97d145f01c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[x\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1a77de523aaaead2fb8dd8f0e986658da7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1aac25faf1b0196c013dd15a734dfff860)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)` |
| `[Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1af9b55d88aab36b4097c95894043abbce)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)` |
| `[IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1a8813657a78778e681ff086d3cf07d94a)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v3/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedBatchNormGradV3::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v3/attrs) | Optional attribute setters for [FusedBatchNormGradV3](fused-batch-norm-grad-v3#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3). |
Public attributes
-----------------
### offset\_backprop
```
::tensorflow::Output offset_backprop
```
### operation
```
Operation operation
```
### reserve\_space\_4
```
::tensorflow::Output reserve_space_4
```
### reserve\_space\_5
```
::tensorflow::Output reserve_space_5
```
### scale\_backprop
```
::tensorflow::Output scale_backprop
```
### x\_backprop
```
::tensorflow::Output x_backprop
```
Public functions
----------------
### FusedBatchNormGradV3
```
FusedBatchNormGradV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input y_backprop,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input reserve_space_1,
::tensorflow::Input reserve_space_2,
::tensorflow::Input reserve_space_3
)
```
### FusedBatchNormGradV3
```
FusedBatchNormGradV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input y_backprop,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input reserve_space_1,
::tensorflow::Input reserve_space_2,
::tensorflow::Input reserve_space_3,
const FusedBatchNormGradV3::Attrs & attrs
)
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Epsilon
```
Attrs Epsilon(
float x
)
```
### IsTraining
```
Attrs IsTraining(
bool x
)
```
tensorflow_cpp tensorflow::ops::ReduceJoin tensorflow::ops::ReduceJoin
===========================
`#include <string_ops.h>`
Joins a string [Tensor](../tensor#classtensorflow_1_1_tensor) across the given dimensions.
Summary
-------
Computes the string join across dimensions in the given string [Tensor](../tensor#classtensorflow_1_1_tensor) of shape `[\\(d_0, d_1, ..., d_{n-1}\\)]`. Returns a new [Tensor](../tensor#classtensorflow_1_1_tensor) created by joining the input strings with the given separator (default: empty string). Negative indices are counted backwards from the end, with `-1` being equivalent to `n - 1`. If indices are not specified, joins across all dimensions beginning from `n - 1` through `0`.
For example:
```
# tensor `a` is [["a", "b"], ["c", "d"]]
tf.reduce_join(a, 0) ==> ["ac", "bd"]
tf.reduce_join(a, 1) ==> ["ab", "cd"]
tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
tf.reduce_join(a, [0, 1]) ==> "acbd"
tf.reduce_join(a, [1, 0]) ==> "abcd"
tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* inputs: The input to be joined. [All](all#classtensorflow_1_1ops_1_1_all) reduced indices must have non-zero size.
* reduction\_indices: The dimensions to reduce over. Dimensions are reduced in the order specified. Omitting `reduction_indices` is equivalent to passing `[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)`):
* keep\_dims: If `True`, retain reduced dimensions with length `1`.
* separator: The separator to use when joining.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has shape equal to that of the input with reduced dimensions removed or set to `1` depending on `keep_dims`.
| Constructors and Destructors |
| --- |
| `[ReduceJoin](#classtensorflow_1_1ops_1_1_reduce_join_1a5a26b37735fa42ff7193a838ad779913)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_indices)` |
| `[ReduceJoin](#classtensorflow_1_1ops_1_1_reduce_join_1a16f60dfc9dd223f31647f7d6b2b8b2aa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reduction_indices, const [ReduceJoin::Attrs](../../../struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reduce_join_1ae3c932b8ed453d9ad3c543af34f90263)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_reduce_join_1aae2b38746b0a6787c6bda531650a94df)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_reduce_join_1a82dc1971263a0bc85f85e9f9cba8ab5f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_reduce_join_1a205e8612d71b9bf0327d0983fceacbd7)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_reduce_join_1ad25cf42911f8ba258fbaf2e6ccddb063)() const` | |
| Public static functions |
| --- |
| `[KeepDims](#classtensorflow_1_1ops_1_1_reduce_join_1a308bbdd23abc9c952087a7842b3c3c62)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)` |
| `[Separator](#classtensorflow_1_1ops_1_1_reduce_join_1aa888289eecaa69b2883039ade1ad7598)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ReduceJoin::Attrs](../../../struct/tensorflow/ops/reduce-join/attrs) | Optional attribute setters for [ReduceJoin](reduce-join#classtensorflow_1_1ops_1_1_reduce_join). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ReduceJoin
```
ReduceJoin(
const ::tensorflow::Scope & scope,
::tensorflow::Input inputs,
::tensorflow::Input reduction_indices
)
```
### ReduceJoin
```
ReduceJoin(
const ::tensorflow::Scope & scope,
::tensorflow::Input inputs,
::tensorflow::Input reduction_indices,
const ReduceJoin::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### KeepDims
```
Attrs KeepDims(
bool x
)
```
### Separator
```
Attrs Separator(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::MatrixSetDiagV3 tensorflow::ops::MatrixSetDiagV3
================================
`#include <array_ops.h>`
Returns a batched matrix tensor with new batched diagonal values.
Summary
-------
Given `input` and `diagonal`, this operation returns a tensor with the same shape and values as `input`, except for the specified diagonals of the innermost matrices. These will be overwritten by the values in `diagonal`.
`input` has `r+1` dimensions `[I, J, ..., L, M, N]`. When `k` is scalar or `k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`. Otherwise, it has `r+1` dimensions `[I, J, ..., L, num_diags, max_diag_len]`. `num_diags` is the number of diagonals, `num_diags = k[1] - k[0] + 1`. `max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`, `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))`
The output is a tensor of rank `k+1` with dimensions `[I, J, ..., L, M, N]`. If `k` is scalar or `k[0] == k[1]`:
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
input[i, j, ..., l, m, n] ; otherwise
```
Otherwise,
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
input[i, j, ..., l, m, n] ; otherwise
```
where `d = n - m`
, `diag_index = k[1] - d`
, and `index_in_diag = n - max(d, 0) + offset`
. `offset` is zero except when the alignment of the diagonal is to the right.
```
offset = max_diag_len - diag_len(d) ; if (`align` in {RIGHT_LEFT, RIGHT_RIGHT}
and `d >= 0`) or
(`align` in {LEFT_RIGHT, RIGHT_RIGHT}
and `d <= 0`)
0 ; otherwise
```
where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`
. For example:
```
# The main diagonal.
input = np.array([[[7, 7, 7, 7], # Input shape: (2, 3, 4)
[7, 7, 7, 7],
[7, 7, 7, 7]],
[[7, 7, 7, 7],
[7, 7, 7, 7],
[7, 7, 7, 7]]])
diagonal = np.array([[1, 2, 3], # Diagonal shape: (2, 3)
[4, 5, 6]])
tf.matrix_set_diag(input, diagonal)
==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)
[7, 2, 7, 7],
[7, 7, 3, 7]],
[[4, 7, 7, 7],
[7, 5, 7, 7],
[7, 7, 6, 7]]]
```
```
# A superdiagonal (per batch).
tf.matrix_set_diag(input, diagonal, k = 1)
==> [[[7, 1, 7, 7], # Output shape: (2, 3, 4)
[7, 7, 2, 7],
[7, 7, 7, 3]],
[[7, 4, 7, 7],
[7, 7, 5, 7],
[7, 7, 7, 6]]]
```
```
# A band of diagonals.
diagonals = np.array([[[0, 9, 1], # Diagonal shape: (2, 4, 3)
[6, 5, 8],
[1, 2, 3],
[4, 5, 0]],
[[0, 1, 2],
[5, 6, 4],
[6, 1, 2],
[3, 4, 0]]])
tf.matrix_set_diag(input, diagonals, k = (-1, 2))
==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4)
[4, 2, 5, 1],
[7, 5, 3, 8]],
[[6, 5, 1, 7],
[3, 1, 6, 2],
[7, 4, 2, 4]]]
```
```
# LEFT_RIGHT alignment.
diagonals = np.array([[[9, 1, 0], # Diagonal shape: (2, 4, 3)
[6, 5, 8],
[1, 2, 3],
[0, 4, 5]],
[[1, 2, 0],
[5, 6, 4],
[6, 1, 2],
[0, 3, 4]]])
tf.matrix_set_diag(input, diagonals, k = (-1, 2), align="LEFT_RIGHT")
==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4)
[4, 2, 5, 1],
[7, 5, 3, 8]],
[[6, 5, 1, 7],
[3, 1, 6, 2],
[7, 4, 2, 4]]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `r+1`, where `r >= 1`.
* diagonal: Rank `r` when `k` is an integer or `k[0] == k[1]`. Otherwise, it has rank `r+1`. `k >= 1`.
* k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. `k[0]` must not be larger than `k[1]`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/matrix-set-diag-v3/attrs#structtensorflow_1_1ops_1_1_matrix_set_diag_v3_1_1_attrs)`):
* align: Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT\_LEFT" (default), "LEFT\_RIGHT", "LEFT\_LEFT", and "RIGHT\_RIGHT". "RIGHT\_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT\_RIGHT", which is the opposite alignment.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Rank `r+1`, with `output.shape = input.shape`.
| Constructors and Destructors |
| --- |
| `[MatrixSetDiagV3](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1aa1c50423313605b235615b20b525285d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k)` |
| `[MatrixSetDiagV3](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1a581008278c2f4caccfe290b868cc9790)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k, const [MatrixSetDiagV3::Attrs](../../../struct/tensorflow/ops/matrix-set-diag-v3/attrs#structtensorflow_1_1ops_1_1_matrix_set_diag_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1aa97bc3e979e617469d1ef1df3b816663)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1a07f228688563f554887686af516dd9a1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1a15eca00505d35ebcd159a9fb0fab1640)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1af545db03e9535f6c8be459ac4b684047)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1a9005a31328cf4653bd9fda4ff88b6bbf)() const` | |
| Public static functions |
| --- |
| `[Align](#classtensorflow_1_1ops_1_1_matrix_set_diag_v3_1a60c1784ebf8f798d1b35e1143c07b467)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/matrix-set-diag-v3/attrs#structtensorflow_1_1ops_1_1_matrix_set_diag_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MatrixSetDiagV3::Attrs](../../../struct/tensorflow/ops/matrix-set-diag-v3/attrs) | Optional attribute setters for [MatrixSetDiagV3](matrix-set-diag-v3#classtensorflow_1_1ops_1_1_matrix_set_diag_v3). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MatrixSetDiagV3
```
MatrixSetDiagV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input diagonal,
::tensorflow::Input k
)
```
### MatrixSetDiagV3
```
MatrixSetDiagV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input diagonal,
::tensorflow::Input k,
const MatrixSetDiagV3::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Align
```
Attrs Align(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::NthElement tensorflow::ops::NthElement
===========================
`#include <nn_ops.h>`
Finds values of the `n`-th order statistic for the last dimension.
Summary
-------
If the input is a vector (rank-1), finds the entries which is the nth-smallest value in the vector and outputs their values as scalar tensor.
For matrices (resp. higher rank input), computes the entries which is the nth-smallest value in each row (resp. vector along the last dimension). Thus,
```
values.shape = input.shape[:-1]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 1-D or higher with last dimension at least `n+1`.
* n: 0-D. Position of sorted vector to select along the last dimension (along each row for matrices). Valid range of n is `[0, input.shape[:-1])`
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/nth-element/attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs)`):
* reverse: When set to True, find the nth-largest value in the vector and vice versa.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The `n`-th order statistic along each last dimensional slice.
| Constructors and Destructors |
| --- |
| `[NthElement](#classtensorflow_1_1ops_1_1_nth_element_1ad57d32106099de0a7c5cd0e118f56250)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) n)` |
| `[NthElement](#classtensorflow_1_1ops_1_1_nth_element_1a2c84dbdc0bb358d13e010718142e8462)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) n, const [NthElement::Attrs](../../../struct/tensorflow/ops/nth-element/attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_nth_element_1a41b2c3dfd7a0fa9341473a14fab18494)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_nth_element_1a2b48d7270f25613807700819eff1cb49)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_nth_element_1a3f9b0440c04a7d951228451e291f008b)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_nth_element_1a9c60d391af60a8d7c268aacbf8a7093b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_nth_element_1ab7ba43882ec3623ce6d7c9bd9e2b47ba)() const` | |
| Public static functions |
| --- |
| `[Reverse](#classtensorflow_1_1ops_1_1_nth_element_1ad86f92398afd7420e3f6db7643954291)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/nth-element/attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::NthElement::Attrs](../../../struct/tensorflow/ops/nth-element/attrs) | Optional attribute setters for [NthElement](nth-element#classtensorflow_1_1ops_1_1_nth_element). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::Output values
```
Public functions
----------------
### NthElement
```
NthElement(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input n
)
```
### NthElement
```
NthElement(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input n,
const NthElement::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Reverse
```
Attrs Reverse(
bool x
)
```
tensorflow_cpp tensorflow::ops::OneHot tensorflow::ops::OneHot
=======================
`#include <array_ops.h>`
Returns a one-hot tensor.
Summary
-------
The locations represented by indices in `indices` take value `on_value`, while all other locations take value `off_value`.
If the input `indices` is rank `N`, the output will have rank `N+1`, The new axis is created at dimension `axis` (default: the new axis is appended at the end).
If `indices` is a scalar the output shape will be a vector of length `depth`.
If `indices` is a vector of length `features`, the output shape will be:
```
features x depth if axis == -1
depth x features if axis == 0
```
If `indices` is a matrix (batch) with shape `[batch, features]`, the output shape will be:
```
batch x features x depth if axis == -1
batch x depth x features if axis == 1
depth x batch x features if axis == 0
```
Examples
========
Suppose that
```
indices = [0, 2, -1, 1]
depth = 3
on_value = 5.0
off_value = 0.0
axis = -1
```
Then output is `[4 x 3]`:
```
output =
[5.0 0.0 0.0] // one_hot(0)
[0.0 0.0 5.0] // one_hot(2)
[0.0 0.0 0.0] // one_hot(-1)
[0.0 5.0 0.0] // one_hot(1)
```
Suppose that
```
indices = [0, 2, -1, 1]
depth = 3
on_value = 0.0
off_value = 3.0
axis = 0
```
Then output is `[3 x 4]`:
```
output =
[0.0 3.0 3.0 3.0]
[3.0 3.0 3.0 0.0]
[3.0 3.0 3.0 3.0]
[3.0 0.0 3.0 3.0]
// ^ one_hot(0)
// ^ one_hot(2)
// ^ one_hot(-1)
// ^ one_hot(1)
```
Suppose that
```
indices = [[0, 2], [1, -1]]
depth = 3
on_value = 1.0
off_value = 0.0
axis = -1
```
Then output is `[2 x 2 x 3]`:
```
output =
[
[1.0, 0.0, 0.0] // one_hot(0)
[0.0, 0.0, 1.0] // one_hot(2)
][
[0.0, 1.0, 0.0] // one_hot(1)
[0.0, 0.0, 0.0] // one_hot(-1)
]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: A tensor of indices.
* depth: A scalar defining the depth of the one hot dimension.
* on\_value: A scalar defining the value to fill in output when `indices[j] = i`.
* off\_value: A scalar defining the value to fill in output when `indices[j] != i`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/one-hot/attrs#structtensorflow_1_1ops_1_1_one_hot_1_1_attrs)`):
* axis: The axis to fill (default: -1, a new inner-most axis).
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The one-hot tensor.
| Constructors and Destructors |
| --- |
| `[OneHot](#classtensorflow_1_1ops_1_1_one_hot_1a854f72c62e64f05c6b259c56ea5734bf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) depth, ::[tensorflow::Input](../input#classtensorflow_1_1_input) on_value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) off_value)` |
| `[OneHot](#classtensorflow_1_1ops_1_1_one_hot_1a606bee0fc38c4a1041cb1cd0be5920ca)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) depth, ::[tensorflow::Input](../input#classtensorflow_1_1_input) on_value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) off_value, const [OneHot::Attrs](../../../struct/tensorflow/ops/one-hot/attrs#structtensorflow_1_1ops_1_1_one_hot_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_one_hot_1aa5fc51f1f352f7ce7ffb0906b98ab4ec)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_one_hot_1a120b99aec6bb831f0cec75b08bb8ab99)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_one_hot_1a79ee3b14e2833cd20e87ac9ed19c8852)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_one_hot_1afd6cf127f64b799170e3bbdb63bbf3a8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_one_hot_1aeb4ae438117dbe3d0e9a0ff8af670b54)() const` | |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_one_hot_1a11c56717df9255c7d78ae73a2a9349f6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/one-hot/attrs#structtensorflow_1_1ops_1_1_one_hot_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OneHot::Attrs](../../../struct/tensorflow/ops/one-hot/attrs) | Optional attribute setters for [OneHot](one-hot#classtensorflow_1_1ops_1_1_one_hot). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### OneHot
```
OneHot(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
::tensorflow::Input depth,
::tensorflow::Input on_value,
::tensorflow::Input off_value
)
```
### OneHot
```
OneHot(
const ::tensorflow::Scope & scope,
::tensorflow::Input indices,
::tensorflow::Input depth,
::tensorflow::Input on_value,
::tensorflow::Input off_value,
const OneHot::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
tensorflow_cpp tensorflow::ops::DivNoNan tensorflow::ops::DivNoNan
=========================
`#include <math_ops.h>`
Returns 0 if the denominator is zero.
Summary
-------
*NOTE*: `[DivNoNan](div-no-nan#classtensorflow_1_1ops_1_1_div_no_nan)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[DivNoNan](#classtensorflow_1_1ops_1_1_div_no_nan_1a9d2aed125515fb8f25c21307ec51c25f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_div_no_nan_1a52f7e0ee4c45eebb6b249ab0b275ce4e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_div_no_nan_1a55107e26ac01d006344cee48f71d2444)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_div_no_nan_1a159c9feb45badb0a54f6299f388edeec)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_div_no_nan_1a9173fbcd035b66fe11ed54469322aad0)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_div_no_nan_1a3a7cb1eff3d3843c2515decfba5fddd3)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### DivNoNan
```
DivNoNan(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RegexReplace tensorflow::ops::RegexReplace
=============================
`#include <string_ops.h>`
Replaces matches of the `pattern` regular expression in `input` with the replacement string provided in `rewrite`.
Summary
-------
It follows the re2 syntax (<https://github.com/google/re2/wiki/Syntax>)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: The text to be processed.
* pattern: The regular expression to be matched in the `input` strings.
* rewrite: The rewrite string to be substituted for the `pattern` expression where it is matched in the `input` strings.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/regex-replace/attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs)`):
* replace\_global: If True, the replacement is global (that is, all matches of the `pattern` regular expression in each input string are rewritten), otherwise the `rewrite` substitution is only made for the first `pattern` match.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The text after applying pattern match and rewrite substitution.
| Constructors and Destructors |
| --- |
| `[RegexReplace](#classtensorflow_1_1ops_1_1_regex_replace_1a476950575052dd378f93320dfb8abeac)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pattern, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rewrite)` |
| `[RegexReplace](#classtensorflow_1_1ops_1_1_regex_replace_1a789bb5399331382a4344de266971b9a1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pattern, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rewrite, const [RegexReplace::Attrs](../../../struct/tensorflow/ops/regex-replace/attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_regex_replace_1a7dda8b284f9da03cdb8789215ce49f6e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_regex_replace_1a5aaa612bfbbe1062fb3a7edba850dc08)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_regex_replace_1af7c8b0135952cc634c3d1eeae9d7e037)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_regex_replace_1a0278c9b0f91ce7ea1ce36d07d960c0f8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_regex_replace_1aadbcd5dc87a024bfd055536f882464bd)() const` | |
| Public static functions |
| --- |
| `[ReplaceGlobal](#classtensorflow_1_1ops_1_1_regex_replace_1a5a363e91c2910ff82c7ed8ea2454f7de)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/regex-replace/attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RegexReplace::Attrs](../../../struct/tensorflow/ops/regex-replace/attrs) | Optional attribute setters for [RegexReplace](regex-replace#classtensorflow_1_1ops_1_1_regex_replace). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RegexReplace
```
RegexReplace(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input pattern,
::tensorflow::Input rewrite
)
```
### RegexReplace
```
RegexReplace(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input pattern,
::tensorflow::Input rewrite,
const RegexReplace::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### ReplaceGlobal
```
Attrs ReplaceGlobal(
bool x
)
```
tensorflow_cpp tensorflow::ops::QuantizedReluX tensorflow::ops::QuantizedReluX
===============================
`#include <nn_ops.h>`
Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)`
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_features: The float value that the lowest quantized value represents.
* max\_features: The float value that the highest quantized value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` activations: Has the same output shape as "features".
* `[Output](../output#classtensorflow_1_1_output)` min\_activations: The float value that the lowest quantized value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_activations: The float value that the highest quantized value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedReluX](#classtensorflow_1_1ops_1_1_quantized_relu_x_1a5509eb6445753af1e18a06d139885f02)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_features)` |
| `[QuantizedReluX](#classtensorflow_1_1ops_1_1_quantized_relu_x_1afed49bee2c994cad34ec5c1462161fa8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_features, const [QuantizedReluX::Attrs](../../../struct/tensorflow/ops/quantized-relu-x/attrs#structtensorflow_1_1ops_1_1_quantized_relu_x_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[activations](#classtensorflow_1_1ops_1_1_quantized_relu_x_1a594fb96f49dbedf8a3810caf4886bc3e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[max\_activations](#classtensorflow_1_1ops_1_1_quantized_relu_x_1a609f233b7ea6a001d77cadd7ff184561)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_activations](#classtensorflow_1_1ops_1_1_quantized_relu_x_1a3165bc8619ed4997ca3592545cbfa209)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_relu_x_1a87f9e55b0b58742fc7c2d2a819b66c18)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[OutType](#classtensorflow_1_1ops_1_1_quantized_relu_x_1aab024e89293405d30cf1c3e18034a56c)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-relu-x/attrs#structtensorflow_1_1ops_1_1_quantized_relu_x_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedReluX::Attrs](../../../struct/tensorflow/ops/quantized-relu-x/attrs) | Optional attribute setters for [QuantizedReluX](quantized-relu-x#classtensorflow_1_1ops_1_1_quantized_relu_x). |
Public attributes
-----------------
### activations
```
::tensorflow::Output activations
```
### max\_activations
```
::tensorflow::Output max_activations
```
### min\_activations
```
::tensorflow::Output min_activations
```
### operation
```
Operation operation
```
Public functions
----------------
### QuantizedReluX
```
QuantizedReluX(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input max_value,
::tensorflow::Input min_features,
::tensorflow::Input max_features
)
```
### QuantizedReluX
```
QuantizedReluX(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input max_value,
::tensorflow::Input min_features,
::tensorflow::Input max_features,
const QuantizedReluX::Attrs & attrs
)
```
Public static functions
-----------------------
### OutType
```
Attrs OutType(
DataType x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ParameterizedTruncatedNormal tensorflow::ops::ParameterizedTruncatedNormal
=============================================
`#include <random_ops.h>`
Outputs random values from a normal distribution.
Summary
-------
The parameters may each be a
scalar which applies to the entire output, or a vector of length shape[0] which stores the parameters for each batch.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: The shape of the output tensor. Batches are indexed by the 0th dimension.
* means: The mean parameter of each batch.
* stdevs: The standard deviation parameter of each batch. Must be greater than 0.
* minvals: The minimum cutoff. May be -infinity.
* maxvals: The maximum cutoff. May be +infinity, and must be more than the minval for each batch.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/parameterized-truncated-normal/attrs#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A matrix of shape num\_batches x samples\_per\_batch, filled with random truncated normal values using the parameters for each row.
| Constructors and Destructors |
| --- |
| `[ParameterizedTruncatedNormal](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1af8d4ae1d204cc4ef9a6361f11cbb90de)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) means, ::[tensorflow::Input](../input#classtensorflow_1_1_input) stdevs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) minvals, ::[tensorflow::Input](../input#classtensorflow_1_1_input) maxvals)` |
| `[ParameterizedTruncatedNormal](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1afd00b3375c16739bcc7f72c930c1f751)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) means, ::[tensorflow::Input](../input#classtensorflow_1_1_input) stdevs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) minvals, ::[tensorflow::Input](../input#classtensorflow_1_1_input) maxvals, const [ParameterizedTruncatedNormal::Attrs](../../../struct/tensorflow/ops/parameterized-truncated-normal/attrs#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1a3447014cf835b9d848b15705f2e11045)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1a87a77c67acb67f7dabb5cb5673ebb0d9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1a9a37bcf56736b38f0eb696e4b39136dc)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1afb3d837950cf0d7cd289cdd5305d2144)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1aef7ad0f3b76382aa50451e91b459cac9)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1a60be0f9d8ac8255d74a9c8d0a16ba1b6)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parameterized-truncated-normal/attrs#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_parameterized_truncated_normal_1a90dde5272c669275d2e05df64fdbc647)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parameterized-truncated-normal/attrs#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ParameterizedTruncatedNormal::Attrs](../../../struct/tensorflow/ops/parameterized-truncated-normal/attrs) | Optional attribute setters for [ParameterizedTruncatedNormal](parameterized-truncated-normal#classtensorflow_1_1ops_1_1_parameterized_truncated_normal). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ParameterizedTruncatedNormal
```
ParameterizedTruncatedNormal(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input means,
::tensorflow::Input stdevs,
::tensorflow::Input minvals,
::tensorflow::Input maxvals
)
```
### ParameterizedTruncatedNormal
```
ParameterizedTruncatedNormal(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
::tensorflow::Input means,
::tensorflow::Input stdevs,
::tensorflow::Input minvals,
::tensorflow::Input maxvals,
const ParameterizedTruncatedNormal::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
tensorflow_cpp tensorflow::ops::MapStage tensorflow::ops::MapStage
=========================
`#include <data_flow_ops.h>`
[Stage](stage#classtensorflow_1_1ops_1_1_stage) (key, values) in the underlying container which behaves like a hashtable.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* key: int64
* values: a list of tensors dtypes A list of data types that inserted values should adhere to.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/map-stage/attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)`):
* capacity: [Maximum](maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: It is necessary to match this name to the matching [Unstage](unstage#classtensorflow_1_1ops_1_1_unstage) Op.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[MapStage](#classtensorflow_1_1ops_1_1_map_stage_1a96efde41d66d5902db410cc77b352ad3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, const DataTypeSlice & dtypes)` |
| `[MapStage](#classtensorflow_1_1ops_1_1_map_stage_1a41b5cfe02a707042d3c3c881eda36739)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, const DataTypeSlice & dtypes, const [MapStage::Attrs](../../../struct/tensorflow/ops/map-stage/attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_map_stage_1ac38d712101aa6817d18caba2579b3895)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_map_stage_1a7c0f17fb6d8fa767634c7740d900cac7)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_stage_1a0070decd553e9628b3eb3289a5f093ef)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-stage/attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_stage_1a2eb61fff7f17f8691d32bcce4849b123)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-stage/attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_stage_1add9bf6cbb8002f22906c0a4b0014fc10)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-stage/attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_stage_1a64188fec364335793fa9c2ddbc6ce7fa)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-stage/attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapStage::Attrs](../../../struct/tensorflow/ops/map-stage/attrs) | Optional attribute setters for [MapStage](map-stage#classtensorflow_1_1ops_1_1_map_stage). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### MapStage
```
MapStage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
::tensorflow::InputList values,
const DataTypeSlice & dtypes
)
```
### MapStage
```
MapStage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
::tensorflow::InputList values,
const DataTypeSlice & dtypes,
const MapStage::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseAccumulatorApplyGradient tensorflow::ops::SparseAccumulatorApplyGradient
===============================================
`#include <data_flow_ops.h>`
Applies a sparse gradient to a given accumulator.
Summary
-------
Does not add if local\_step is smaller than the accumulator's global\_step.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a accumulator.
* local\_step: The local\_step value at which the sparse gradient was computed.
* gradient\_indices: Indices of the sparse gradient to be accumulated. Must be a vector.
* gradient\_values: Values are the non-zero slices of the gradient, and must have the same first dimension as indices, i.e., the nnz represented by indices and values must be consistent.
* gradient\_shape: Shape of the sparse gradient to be accumulated.
* has\_known\_shape: Boolean indicating whether gradient\_shape is unknown, in which case the input is ignored during validation.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[SparseAccumulatorApplyGradient](#classtensorflow_1_1ops_1_1_sparse_accumulator_apply_gradient_1aea8779790821fa94116859fd1dd3b604)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) local_step, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_shape, bool has_known_shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_accumulator_apply_gradient_1ae497952e7990fb56ce68d8add07c12c7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_sparse_accumulator_apply_gradient_1a5ddfee38bced0cfafa1b427590f331ef)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### SparseAccumulatorApplyGradient
```
SparseAccumulatorApplyGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input local_step,
::tensorflow::Input gradient_indices,
::tensorflow::Input gradient_values,
::tensorflow::Input gradient_shape,
bool has_known_shape
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::SerializeSparse tensorflow::ops::SerializeSparse
================================
`#include <sparse_ops.h>`
Serialize a `SparseTensor` into a `[3]``[Tensor](../tensor#classtensorflow_1_1_tensor)` object.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sparse\_indices: 2-D. The `indices` of the `SparseTensor`.
* sparse\_values: 1-D. The `values` of the `SparseTensor`.
* sparse\_shape: 1-D. The `shape` of the `SparseTensor`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/serialize-sparse/attrs#structtensorflow_1_1ops_1_1_serialize_sparse_1_1_attrs)`):
* out\_type: The `dtype` to use for serialization; the supported types are `string` (default) and `variant`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The serialized\_sparse tensor.
| Constructors and Destructors |
| --- |
| `[SerializeSparse](#classtensorflow_1_1ops_1_1_serialize_sparse_1affc9f080117db6a59bb99bc2c3c7ff59)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape)` |
| `[SerializeSparse](#classtensorflow_1_1ops_1_1_serialize_sparse_1ada17cc33b44d83186f73eff53932413e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape, const [SerializeSparse::Attrs](../../../struct/tensorflow/ops/serialize-sparse/attrs#structtensorflow_1_1ops_1_1_serialize_sparse_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_serialize_sparse_1a05fa528b066fa8e55d2f402610dd81ec)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[serialized\_sparse](#classtensorflow_1_1ops_1_1_serialize_sparse_1a504ec93f6c9f36404748a726b7593460)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_serialize_sparse_1a00ce7cd46bd172befb5884bdaa85e6fa)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_serialize_sparse_1a99fd8653e1577d868ea4b65ad7210040)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_serialize_sparse_1a8d2d1f1699d5d3ad9268cf215e87057a)() const` | |
| Public static functions |
| --- |
| `[OutType](#classtensorflow_1_1ops_1_1_serialize_sparse_1a6dc0f941bd58c98382cb0b2ee2fbdbb3)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/serialize-sparse/attrs#structtensorflow_1_1ops_1_1_serialize_sparse_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SerializeSparse::Attrs](../../../struct/tensorflow/ops/serialize-sparse/attrs) | Optional attribute setters for [SerializeSparse](serialize-sparse#classtensorflow_1_1ops_1_1_serialize_sparse). |
Public attributes
-----------------
### operation
```
Operation operation
```
### serialized\_sparse
```
::tensorflow::Output serialized_sparse
```
Public functions
----------------
### SerializeSparse
```
SerializeSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape
)
```
### SerializeSparse
```
SerializeSparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape,
const SerializeSparse::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### OutType
```
Attrs OutType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::ResourceApplyPowerSign tensorflow::ops::ResourceApplyPowerSign
=======================================
`#include <training_ops.h>`
Update '\*var' according to the AddSign update.
Summary
-------
m\_t <- beta1 \* m\_{t-1} + (1 - beta1) \* g update <- exp(logbase \* sign\_decay \* sign(g) \* sign(m\_t)) \* g variable <- variable - lr\_t \* update
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* logbase: Must be a scalar.
* sign\_decay: Must be a scalar.
* beta: Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-power-sign/attrs#structtensorflow_1_1ops_1_1_resource_apply_power_sign_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyPowerSign](#classtensorflow_1_1ops_1_1_resource_apply_power_sign_1a64fbb5964bf72c2c091db1d74f7e9718)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logbase, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyPowerSign](#classtensorflow_1_1ops_1_1_resource_apply_power_sign_1aafa307bbfc680cb368b9f28075ec4896)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) logbase, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sign_decay, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyPowerSign::Attrs](../../../struct/tensorflow/ops/resource-apply-power-sign/attrs#structtensorflow_1_1ops_1_1_resource_apply_power_sign_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_power_sign_1aec6d0cf32a5d557c16f0b7e57a8ce017)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_power_sign_1a371be2a4d0025d896cf612387d55d2d4)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_power_sign_1a242ec9b418fd89da23d52d9a3ddef249)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-power-sign/attrs#structtensorflow_1_1ops_1_1_resource_apply_power_sign_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyPowerSign::Attrs](../../../struct/tensorflow/ops/resource-apply-power-sign/attrs) | Optional attribute setters for [ResourceApplyPowerSign](resource-apply-power-sign#classtensorflow_1_1ops_1_1_resource_apply_power_sign). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyPowerSign
```
ResourceApplyPowerSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input logbase,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad
)
```
### ResourceApplyPowerSign
```
ResourceApplyPowerSign(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input lr,
::tensorflow::Input logbase,
::tensorflow::Input sign_decay,
::tensorflow::Input beta,
::tensorflow::Input grad,
const ResourceApplyPowerSign::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResizeArea tensorflow::ops::ResizeArea
===========================
`#include <image_ops.h>`
Resize `images` to `size` using area interpolation.
Summary
-------
[Input](../input#classtensorflow_1_1_input) images can be of different types but output images are always float.
The range of pixel values for the output image might be slightly different from the range for the input image because of limited numerical precision. To guarantee an output range, for example `[0.0, 1.0]`, apply `tf.clip_by_value` to the output.
Each output pixel is computed by first transforming the pixel's footprint into the input tensor and then averaging the pixels that intersect the footprint. An input pixel's contribution to the average is weighted by the fraction of its area that intersects the footprint. This is the same as OpenCV's INTER\_AREA.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 4-D with shape `[batch, height, width, channels]`.
* size: = A 1-D int32 [Tensor](../tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resize-area/attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs)`):
* align\_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, new_height, new_width, channels]`.
| Constructors and Destructors |
| --- |
| `[ResizeArea](#classtensorflow_1_1ops_1_1_resize_area_1a48c3b130fbd05acaed9512549485f012)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size)` |
| `[ResizeArea](#classtensorflow_1_1ops_1_1_resize_area_1ac1b5d48c5c77399d5198780d905281d7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, const [ResizeArea::Attrs](../../../struct/tensorflow/ops/resize-area/attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resize_area_1a5cb2a40837fb9d975e2ca454469e5cac)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[resized\_images](#classtensorflow_1_1ops_1_1_resize_area_1a64b25c97b7028b2b4c93978f2e957ad4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_resize_area_1abdc62a6906daefaa326cda016f8fbb0c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_resize_area_1a6e7fba9df05a54b4e0de2d079fa03403)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_resize_area_1a15a700424a492dfe07a1777ddc6146bd)() const` | |
| Public static functions |
| --- |
| `[AlignCorners](#classtensorflow_1_1ops_1_1_resize_area_1ae8ffc21c407e98bddb149275984ed3cf)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-area/attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResizeArea::Attrs](../../../struct/tensorflow/ops/resize-area/attrs) | Optional attribute setters for [ResizeArea](resize-area#classtensorflow_1_1ops_1_1_resize_area). |
Public attributes
-----------------
### operation
```
Operation operation
```
### resized\_images
```
::tensorflow::Output resized_images
```
Public functions
----------------
### ResizeArea
```
ResizeArea(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size
)
```
### ResizeArea
```
ResizeArea(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
const ResizeArea::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AlignCorners
```
Attrs AlignCorners(
bool x
)
```
tensorflow_cpp tensorflow::ops::Atan2 tensorflow::ops::Atan2
======================
`#include <math_ops.h>`
Computes arctangent of `y/x` element-wise, respecting signs of the arguments.
Summary
-------
This is the angle \( \theta \in [-\pi, \pi] \) such that \[ x = r \cos(\theta) \] and \[ y = r \sin(\theta) \] where \(r = \sqrt{x^2 + y^2} \).
For example:
x = [1., 1.] y = [1., -1.] print((tf.math.atan2(y,x) \* (180 / np.pi)).numpy()) [ 45. -45.]
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Atan2](#classtensorflow_1_1ops_1_1_atan2_1a8867908f7189331b7487f4c21281a9c8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_atan2_1aff80dea43838497865e0a16a7e1d9d58)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_atan2_1a7db938f09d797c53136299c41262641d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_atan2_1a414eee5876c41280a76b46bf220525d2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_atan2_1a8443a66aa33b9184ce97b4d269fcab71)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_atan2_1a828e41f70d435e0d037e0d7ca40a52de)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Atan2
```
Atan2(
const ::tensorflow::Scope & scope,
::tensorflow::Input y,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::CropAndResize tensorflow::ops::CropAndResize
==============================
`#include <image_ops.h>`
Extracts crops from the input image tensor and resizes them.
Summary
-------
Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a common output size specified by `crop_size`. This is more general than the `crop_to_bounding_box` op which extracts a fixed size slice from the input image and does not allow resizing or aspect ratio change.
Returns a tensor with `crops` from the input `image` at positions defined at the bounding box locations in `boxes`. The cropped boxes are all resized (with bilinear or nearest neighbor interpolation) to a fixed `size = [crop_height, crop_width]`. The result is a 4-D tensor `[num_boxes, crop_height, crop_width, depth]`. The resizing is corner aligned. In particular, if `boxes = [[0, 0, 1, 1]]`, the method will give identical results to using `tf.image.resize_bilinear()` or `tf.image.resize_nearest_neighbor()`(depends on the `method` argument) with `align_corners=True`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* image: A 4-D tensor of shape `[batch, image_height, image_width, depth]`. Both `image_height` and `image_width` need to be positive.
* boxes: A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor specifies the coordinates of a box in the `box_ind[i]` image and is specified in normalized coordinates `[y1, x1, y2, x2]`. A normalized coordinate value of `y` is mapped to the image coordinate at `y * (image_height - 1)`, so as the `[0, 1]` interval of normalized image height is mapped to `[0, image_height - 1]` in image height coordinates. We do allow `y1` > `y2`, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the `[0, 1]` range are allowed, in which case we use `extrapolation_value` to extrapolate the input image values.
* box\_ind: A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. The value of `box_ind[i]` specifies the image that the `i`-th box refers to.
* crop\_size: A 1-D tensor of 2 elements, `size = [crop_height, crop_width]`. [All](all#classtensorflow_1_1ops_1_1_all) cropped image patches are resized to this size. The aspect ratio of the image content is not preserved. Both `crop_height` and `crop_width` need to be positive.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/crop-and-resize/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs)`):
* method: A string specifying the sampling method for resizing. It can be either `"bilinear"` or `"nearest"` and default to `"bilinear"`. Currently two sampling methods are supported: Bilinear and Nearest Neighbor.
* extrapolation\_value: Value used for extrapolation, when applicable.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`.
| Constructors and Destructors |
| --- |
| `[CropAndResize](#classtensorflow_1_1ops_1_1_crop_and_resize_1ab17f07d2b9db2923f4f16cc6ddd10c9d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) box_ind, ::[tensorflow::Input](../input#classtensorflow_1_1_input) crop_size)` |
| `[CropAndResize](#classtensorflow_1_1ops_1_1_crop_and_resize_1adb1d93c1c956c1d654b701bc078ab6ae)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) image, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) box_ind, ::[tensorflow::Input](../input#classtensorflow_1_1_input) crop_size, const [CropAndResize::Attrs](../../../struct/tensorflow/ops/crop-and-resize/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[crops](#classtensorflow_1_1ops_1_1_crop_and_resize_1a3d1569c38bfdd7881539d76880193614)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_crop_and_resize_1ade78876fbd90696b4364af105b775c29)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_crop_and_resize_1a44e6253b604ef5a11098dd6b01034a73)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_crop_and_resize_1a009f32b1c13c815bcb4f1e20bbb506d9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_crop_and_resize_1a27ee3121d018ca29ecc4d112bfe6dbf7)() const` | |
| Public static functions |
| --- |
| `[ExtrapolationValue](#classtensorflow_1_1ops_1_1_crop_and_resize_1a24585f2ae8f486ed7cf26b7636398bbb)(float x)` | `[Attrs](../../../struct/tensorflow/ops/crop-and-resize/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs)` |
| `[Method](#classtensorflow_1_1ops_1_1_crop_and_resize_1a430830e07a336ae16aa3093ed0480d8d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/crop-and-resize/attrs#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::CropAndResize::Attrs](../../../struct/tensorflow/ops/crop-and-resize/attrs) | Optional attribute setters for [CropAndResize](crop-and-resize#classtensorflow_1_1ops_1_1_crop_and_resize). |
Public attributes
-----------------
### crops
```
::tensorflow::Output crops
```
### operation
```
Operation operation
```
Public functions
----------------
### CropAndResize
```
CropAndResize(
const ::tensorflow::Scope & scope,
::tensorflow::Input image,
::tensorflow::Input boxes,
::tensorflow::Input box_ind,
::tensorflow::Input crop_size
)
```
### CropAndResize
```
CropAndResize(
const ::tensorflow::Scope & scope,
::tensorflow::Input image,
::tensorflow::Input boxes,
::tensorflow::Input box_ind,
::tensorflow::Input crop_size,
const CropAndResize::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### ExtrapolationValue
```
Attrs ExtrapolationValue(
float x
)
```
### Method
```
Attrs Method(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::ResizeBilinear tensorflow::ops::ResizeBilinear
===============================
`#include <image_ops.h>`
Resize `images` to `size` using bilinear interpolation.
Summary
-------
[Input](../input#classtensorflow_1_1_input) images can be of different types but output images are always float.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* images: 4-D with shape `[batch, height, width, channels]`.
* size: = A 1-D int32 [Tensor](../tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resize-bilinear/attrs#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs)`):
* align\_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, new_height, new_width, channels]`.
| Constructors and Destructors |
| --- |
| `[ResizeBilinear](#classtensorflow_1_1ops_1_1_resize_bilinear_1a981aa658a845a625503e7e42c2f0885c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size)` |
| `[ResizeBilinear](#classtensorflow_1_1ops_1_1_resize_bilinear_1ad887a5d2954f777b5528579f4c60589b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, const [ResizeBilinear::Attrs](../../../struct/tensorflow/ops/resize-bilinear/attrs#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resize_bilinear_1ac1253b0351c139e9c4782e0ce62c7aa2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[resized\_images](#classtensorflow_1_1ops_1_1_resize_bilinear_1a6487d7e2a3fd89b0ba594300ddd2e2d7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_resize_bilinear_1af9816ad8aa06bfbe416f9ada05a5367c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_resize_bilinear_1a0f822a29ed600eb63bccc395b6540a83)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_resize_bilinear_1aafa3001b38c457833115ce0f523e3751)() const` | |
| Public static functions |
| --- |
| `[AlignCorners](#classtensorflow_1_1ops_1_1_resize_bilinear_1a16fe808dfb000fd2694d1fbe1b706437)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-bilinear/attrs#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs)` |
| `[HalfPixelCenters](#classtensorflow_1_1ops_1_1_resize_bilinear_1a040b5f7ab939a890ca9d83fddc789f91)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-bilinear/attrs#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResizeBilinear::Attrs](../../../struct/tensorflow/ops/resize-bilinear/attrs) | Optional attribute setters for [ResizeBilinear](resize-bilinear#classtensorflow_1_1ops_1_1_resize_bilinear). |
Public attributes
-----------------
### operation
```
Operation operation
```
### resized\_images
```
::tensorflow::Output resized_images
```
Public functions
----------------
### ResizeBilinear
```
ResizeBilinear(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size
)
```
### ResizeBilinear
```
ResizeBilinear(
const ::tensorflow::Scope & scope,
::tensorflow::Input images,
::tensorflow::Input size,
const ResizeBilinear::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AlignCorners
```
Attrs AlignCorners(
bool x
)
```
### HalfPixelCenters
```
Attrs HalfPixelCenters(
bool x
)
```
tensorflow_cpp tensorflow::ops::SparseSoftmax tensorflow::ops::SparseSoftmax
==============================
`#include <sparse_ops.h>`
Applies softmax to a batched N-D `SparseTensor`.
Summary
-------
The inputs represent an N-D SparseTensor with logical shape `[..., B, C]` (where `N >= 2`), and with indices sorted in the canonical lexicographic order.
This op is equivalent to applying the normal `tf.nn.softmax()` to each innermost logical submatrix with shape `[B, C]`, but with the catch that *the implicitly zero elements do not participate*. Specifically, the algorithm is equivalent to the following:
(1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix with shape `[B, C]`, along the size-C dimension; (2) Masks out the original implicitly-zero locations; (3) Renormalizes the remaining elements.
Hence, the `SparseTensor` result has exactly the same non-zero indices and shape.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sp\_indices: 2-D. `NNZ x R` matrix with the indices of non-empty values in a SparseTensor, in canonical ordering.
* sp\_values: 1-D. `NNZ` non-empty values corresponding to `sp_indices`.
* sp\_shape: 1-D. Shape of the input SparseTensor.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D. The `NNZ` values for the result `SparseTensor`.
| Constructors and Destructors |
| --- |
| `[SparseSoftmax](#classtensorflow_1_1ops_1_1_sparse_softmax_1a64ec9c22eb2f8d50797cfb39eb94009d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_shape)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_softmax_1ad2dc43b15de20c26df875d2e2f5e9191)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_softmax_1a94b1fda8269b6888396b9c165fdd28b1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_softmax_1aabb6b649a7d5f3c8a9db2dea2c44ef1a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_softmax_1af6f0269e4c290ac6b8234ba881dafe13)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_softmax_1a1fccadd0a530764ea2d1691045ebf2a5)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSoftmax
```
SparseSoftmax(
const ::tensorflow::Scope & scope,
::tensorflow::Input sp_indices,
::tensorflow::Input sp_values,
::tensorflow::Input sp_shape
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::MaxPoolV2 tensorflow::ops::MaxPoolV2
==========================
`#include <nn_ops.h>`
Performs max pooling on the input.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D input to pool over.
* ksize: The size of the window for each dimension of the input tensor.
* strides: The stride of the sliding window for each dimension of the input tensor.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_v2_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The max pooled output tensor.
| Constructors and Destructors |
| --- |
| `[MaxPoolV2](#classtensorflow_1_1ops_1_1_max_pool_v2_1a930d594a47e94cc480b3284fde63cf74)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ksize, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strides, StringPiece padding)` |
| `[MaxPoolV2](#classtensorflow_1_1ops_1_1_max_pool_v2_1aba4bd18dfc397f223ebd08cc08f62260)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ksize, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strides, StringPiece padding, const [MaxPoolV2::Attrs](../../../struct/tensorflow/ops/max-pool-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_max_pool_v2_1abcaf1a0b7b64607e3a6c0887751c8799)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_max_pool_v2_1a7e407d75df662eba057f89181ef309c3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_max_pool_v2_1adf6f98c16f6a9f1062f1f33591883a2e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool_v2_1a2fbac4002a68a49e88d3407e916173f3)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool_v2_1a8c5f2842741c82f6197b014b5e7e3818)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool_v2_1aee677467f8e25010a3f5628e2d72074d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MaxPoolV2::Attrs](../../../struct/tensorflow/ops/max-pool-v2/attrs) | Optional attribute setters for [MaxPoolV2](max-pool-v2#classtensorflow_1_1ops_1_1_max_pool_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MaxPoolV2
```
MaxPoolV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input ksize,
::tensorflow::Input strides,
StringPiece padding
)
```
### MaxPoolV2
```
MaxPoolV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input ksize,
::tensorflow::Input strides,
StringPiece padding,
const MaxPoolV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Acos tensorflow::ops::Acos
=====================
`#include <math_ops.h>`
Computes acos of x element-wise.
Summary
-------
Provided an input tensor, the `tf.math.acos` operation returns the inverse cosine of each element of the tensor. If `y = tf.math.cos(x)` then, `x = tf.math.acos(y)`.
[Input](../input#classtensorflow_1_1_input) range is `[-1, 1]` and the output has a range of `[0, pi]`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Acos](#classtensorflow_1_1ops_1_1_acos_1ac9955d0a945c94676d6739f202d8f6d8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_acos_1a0cfc48157462e116bbbbd2c3806973fe)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_acos_1ab9fec648c9e6a57e2151776161e0ba0f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_acos_1a7a08b77dad0ab0e0fae2c0be13f93fd9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_acos_1a7b91a2440707e8240da83752cad57965)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_acos_1a6e68abb504d90aaced934bd56471a264)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Acos
```
Acos(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SegmentSum tensorflow::ops::SegmentSum
===========================
`#include <math_ops.h>`
Computes the sum along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Computes a tensor such that \(output\_i = \sum\_j data\_j\) where sum is over `j` such that `segment_ids[j] == i`.
If the sum is empty for a given segment ID `i`, `output[i] = 0`.
Caution: On CPU, values in `segment_ids` are always validated to be sorted, and an error is thrown for indices that are not increasing. On GPU, this does not throw an error for unsorted indices. On GPU, out-of-order indices result in safe but unspecified behavior, which may include treating out-of-order indices as the same as a smaller following index.

For example:
c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.math.segment\_sum(c, tf.constant([0, 0, 1])).numpy() array([[5, 5, 5, 5], [5, 6, 7, 8]], dtype=int32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A 1-D tensor whose size is equal to the size of `data`'s first dimension. Values should be sorted and can be repeated.
Caution: The values are always validated to be sorted on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SegmentSum](#classtensorflow_1_1ops_1_1_segment_sum_1a4f3c70df95d8be6a28060d01172358b5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_segment_sum_1a2a06a8d703c2aaac86320935d50be188)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_segment_sum_1a475eb3ccf98c3aa9097ae79ad39b06ac)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_segment_sum_1a02ad69e7aabc1982f43a6f669d6dd884)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_segment_sum_1ab999a101c40c98e2574092d55e877ec2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_segment_sum_1af298372906f96c26410a5edaeb58a2e4)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SegmentSum
```
SegmentSum(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::TensorArrayGather tensorflow::ops::TensorArrayGather
==================================
`#include <data_flow_ops.h>`
[Gather](gather#classtensorflow_1_1ops_1_1_gather) specific elements from the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into output `value`.
Summary
-------
[All](all#classtensorflow_1_1ops_1_1_all) elements selected by `indices` must have the same shape.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array).
* indices: The locations in the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) from which to read tensor elements.
* flow\_in: A float scalar that enforces proper chaining of operations.
* dtype: The type of the elem that is returned.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/tensor-array-gather/attrs#structtensorflow_1_1ops_1_1_tensor_array_gather_1_1_attrs)`):
* element\_shape: The expected shape of an element, if known. Used to validate the shapes of [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: [All](all#classtensorflow_1_1ops_1_1_all) of the elements in the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array), concatenated along a new axis (the new dimension 0).
| Constructors and Destructors |
| --- |
| `[TensorArrayGather](#classtensorflow_1_1ops_1_1_tensor_array_gather_1a217eb2eb8236b837dd4c47f33e149eb5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, DataType dtype)` |
| `[TensorArrayGather](#classtensorflow_1_1ops_1_1_tensor_array_gather_1acaf1d9394750550499a9d32ab5b6be2c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) flow_in, DataType dtype, const [TensorArrayGather::Attrs](../../../struct/tensorflow/ops/tensor-array-gather/attrs#structtensorflow_1_1ops_1_1_tensor_array_gather_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_gather_1a18cd26c5207c30afc37dc106c73c0862)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[value](#classtensorflow_1_1ops_1_1_tensor_array_gather_1a2df8cf3f750a2eed7cb36b35f8f0ad1f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tensor_array_gather_1af03efcbaca9f1f8165d39cbf23acd99f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tensor_array_gather_1a4c95465b1cb37303cc4b7e3dad7ad411)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tensor_array_gather_1a1d089d1cb6fab2fda60d0fe8b086e91d)() const` | |
| Public static functions |
| --- |
| `[ElementShape](#classtensorflow_1_1ops_1_1_tensor_array_gather_1ad1d8054cb6b334d7903bda4be71a8ade)(PartialTensorShape x)` | `[Attrs](../../../struct/tensorflow/ops/tensor-array-gather/attrs#structtensorflow_1_1ops_1_1_tensor_array_gather_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TensorArrayGather::Attrs](../../../struct/tensorflow/ops/tensor-array-gather/attrs) | Optional attribute setters for [TensorArrayGather](tensor-array-gather#classtensorflow_1_1ops_1_1_tensor_array_gather). |
Public attributes
-----------------
### operation
```
Operation operation
```
### value
```
::tensorflow::Output value
```
Public functions
----------------
### TensorArrayGather
```
TensorArrayGather(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input indices,
::tensorflow::Input flow_in,
DataType dtype
)
```
### TensorArrayGather
```
TensorArrayGather(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input indices,
::tensorflow::Input flow_in,
DataType dtype,
const TensorArrayGather::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### ElementShape
```
Attrs ElementShape(
PartialTensorShape x
)
```
tensorflow_cpp tensorflow::ops::PaddingFIFOQueue tensorflow::ops::PaddingFIFOQueue
=================================
`#include <data_flow_ops.h>`
A queue that produces elements in first-in first-out order.
Summary
-------
Variable-size shapes are allowed by setting the corresponding shape dimensions to 0 in the shape attr. In this case DequeueMany will pad up to the maximum size of any given element in the minibatch. See below for details.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* component\_types: The type of each component in a value.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)`):
* shapes: The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. Shapes of fixed rank but variable size are allowed by setting any shape dimension to -1. In this case, the inputs' shape may vary along the given dimension, and DequeueMany will pad the given dimension with zeros up to the maximum shape of all elements in the given batch. If the length of this attr is 0, different queue elements may have different ranks and shapes, but only one element may be dequeued at a time.
* capacity: The upper bound on the number of elements in this queue. Negative numbers mean no limit.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: If non-empty, this queue will be shared under the given name across multiple sessions.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The handle to the queue.
| Constructors and Destructors |
| --- |
| `[PaddingFIFOQueue](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1ab818a0fb5c04118f9fb6a16f8d014bbf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types)` |
| `[PaddingFIFOQueue](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a6d7f8309f142ac9ffe7ec1de8a99e11e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & component_types, const [PaddingFIFOQueue::Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[handle](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a39eb929611f708215faf1b5be357152e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a73da6dae81f48ea4ac530b3cc265391e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a60fdcd5f1e0d321510d5f1924e5ebb98)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a87a368787c970ea80238b0b277d4a1bc)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a24634a5ec26c56d5bf58e40e5f30ec00)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1ae1fa5194a675ccd0aac3d90adb2a5d7e)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a4d0859f5e43500c22a24ccf99f0b8ac8)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` |
| `[Shapes](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a29f0f0ce152db5f4517d7355650f6d2d)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1a182e79127160fbc1a6af358ebd5bf0c7)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::PaddingFIFOQueue::Attrs](../../../struct/tensorflow/ops/padding-f-i-f-o-queue/attrs) | Optional attribute setters for [PaddingFIFOQueue](padding-f-i-f-o-queue#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue). |
Public attributes
-----------------
### handle
```
::tensorflow::Output handle
```
### operation
```
Operation operation
```
Public functions
----------------
### PaddingFIFOQueue
```
PaddingFIFOQueue(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types
)
```
### PaddingFIFOQueue
```
PaddingFIFOQueue(
const ::tensorflow::Scope & scope,
const DataTypeSlice & component_types,
const PaddingFIFOQueue::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### Shapes
```
Attrs Shapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseSegmentMean tensorflow::ops::SparseSegmentMean
==================================
`#include <math_ops.h>`
Computes the mean along sparse segments of a tensor.
Summary
-------
See `tf.sparse.segment_sum` for usage examples.
Like `[SegmentMean](segment-mean#classtensorflow_1_1ops_1_1_segment_mean)`, but `segment_ids` can have rank less than `data`'s first dimension, selecting a subset of dimension 0, specified by `indices`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: A 1-D tensor. Has same rank as `segment_ids`.
* segment\_ids: A 1-D tensor. Values should be sorted and can be repeated.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SparseSegmentMean](#classtensorflow_1_1ops_1_1_sparse_segment_mean_1a2b035f5d497b4354b79c35cde0868e49)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_mean_1a26621912df2877be3e9ab8041f43663a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_segment_mean_1a7cd157432ca347f2c4262909896097cf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_segment_mean_1af15317f10be1d8518a25b69848962916)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_mean_1ad6a04426e5d9dd99a38bcb084e407eda)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_mean_1ab5d230baf0773a4ec3535973bfaca162)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseSegmentMean
```
SparseSegmentMean(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input indices,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Dilation2D tensorflow::ops::Dilation2D
===========================
`#include <nn_ops.h>`
Computes the grayscale dilation of 4-D `input` and 3-D `filter` tensors.
Summary
-------
The `input` tensor has shape `[batch, in_height, in_width, depth]` and the `filter` tensor has shape `[filter_height, filter_width, depth]`, i.e., each input channel is processed independently of the others with its own structuring function. The `output` tensor has shape `[batch, out_height, out_width, depth]`. The spatial dimensions of the output tensor depend on the `padding` algorithm. We currently only support the default "NHWC" `data_format`.
In detail, the grayscale morphological 2-D dilation is the max-sum correlation (for consistency with `conv2d`, we use unmirrored filters):
```
output[b, y, x, c] =
max_{dy, dx} input[b,
strides[1] * y + rates[1] * dy,
strides[2] * x + rates[2] * dx,
c] +
filter[dy, dx, c]
```
Max-pooling is a special case when the filter has size equal to the pooling kernel size and contains all zeros.
Note on duality: The dilation of `input` by the `filter` is equal to the negation of the erosion of `-input` by the reflected `filter`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, in_height, in_width, depth]`.
* filter: 3-D with shape `[filter_height, filter_width, depth]`.
* strides: The stride of the sliding window for each dimension of the input tensor. Must be: `[1, stride_height, stride_width, 1]`.
* rates: The input stride for atrous morphological dilation. Must be: `[1, rate_height, rate_width, 1]`.
* padding: The type of padding algorithm to use.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, out_height, out_width, depth]`.
| Constructors and Destructors |
| --- |
| `[Dilation2D](#classtensorflow_1_1ops_1_1_dilation2_d_1aa7fba6ab148288fc230175c265483ff3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter, const gtl::ArraySlice< int > & strides, const gtl::ArraySlice< int > & rates, StringPiece padding)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_dilation2_d_1a50e0232a57e1ec03bc56803f2e2ae58e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_dilation2_d_1ae68b7f48c9fc91ffdef4e18bd34625f0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_dilation2_d_1a965eb807b87a9ac84ef8533e6da72768)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_dilation2_d_1ae1a45a55c3092ef319c027a697e3e667)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_dilation2_d_1a451d294669723935c6618946259273c3)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Dilation2D
```
Dilation2D(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter,
const gtl::ArraySlice< int > & strides,
const gtl::ArraySlice< int > & rates,
StringPiece padding
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseMatMul tensorflow::ops::SparseMatMul
=============================
`#include <math_ops.h>`
[Multiply](multiply#classtensorflow_1_1ops_1_1_multiply) matrix "a" by matrix "b".
Summary
-------
The inputs must be two-dimensional matrices and the inner dimension of "a" must match the outer dimension of "b". Both "a" and "b" must be `[Tensor](../tensor#classtensorflow_1_1_tensor)`s not `SparseTensor`s. This op is optimized for the case where at least one of "a" or "b" is sparse, in the sense that they have a large proportion of zero values. The breakeven for using this versus a dense matrix multiply on one platform was 30% zero values in the sparse matrix.
The gradient computation of this operation will only take advantage of sparsity in the input gradient when that gradient comes from a [Relu](relu#classtensorflow_1_1ops_1_1_relu).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The product tensor.
| Constructors and Destructors |
| --- |
| `[SparseMatMul](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a44ec3b9c8a4a6c27ec1e5defa921a8c2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b)` |
| `[SparseMatMul](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a29e8ca18f70b1f18d2d5931606fa5108)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b, const [SparseMatMul::Attrs](../../../struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1af4bedc3c3ba71553d0c1e30513898430)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[product](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a9b708969f18250faa3e40edad285ae45)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1ae461c34d275e4d996e21af14b8870531)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a7e6d0d764e73510a120ea967abaf9250)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a3fee7729e51d2b640d654a25a84f0185)() const` | |
| Public static functions |
| --- |
| `[AIsSparse](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1acaa26e8e9d1e5854dcfef57dcb4efd5b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` |
| `[BIsSparse](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1aaf87a4805b8269233969a514bea852ef)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` |
| `[TransposeA](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a41b864162f17688227aa34ee4d8021b2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` |
| `[TransposeB](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1af58949ad4394aa0ba7869e65ba742487)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseMatMul::Attrs](../../../struct/tensorflow/ops/sparse-mat-mul/attrs) | Optional attribute setters for [SparseMatMul](sparse-mat-mul#classtensorflow_1_1ops_1_1_sparse_mat_mul). |
Public attributes
-----------------
### operation
```
Operation operation
```
### product
```
::tensorflow::Output product
```
Public functions
----------------
### SparseMatMul
```
SparseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b
)
```
### SparseMatMul
```
SparseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b,
const SparseMatMul::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AIsSparse
```
Attrs AIsSparse(
bool x
)
```
### BIsSparse
```
Attrs BIsSparse(
bool x
)
```
### TransposeA
```
Attrs TransposeA(
bool x
)
```
### TransposeB
```
Attrs TransposeB(
bool x
)
```
tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxArgsGradient tensorflow::ops::FakeQuantWithMinMaxArgsGradient
================================================
`#include <array_ops.h>`
Compute gradients for a [FakeQuantWithMinMaxArgs](fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) operation.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* gradients: Backpropagated gradients above the [FakeQuantWithMinMaxArgs](fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) operation.
* inputs: Values passed as inputs to the [FakeQuantWithMinMaxArgs](fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) operation.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Backpropagated gradients below the [FakeQuantWithMinMaxArgs](fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) operation: `gradients * (inputs >= min && inputs <= max)`.
| Constructors and Destructors |
| --- |
| `[FakeQuantWithMinMaxArgsGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1aa93814dc39884eabcb7795a3a660dd41)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs)` |
| `[FakeQuantWithMinMaxArgsGradient](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1ada606f99c6ddc3dd650ef87b1c703a4a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, const [FakeQuantWithMinMaxArgsGradient::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[backprops](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1aabc243ded217d2349720a4b4057391ab)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1ae30d5d38310d4c2cc419c75f36a3f1a8)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1a14762cf991900719bc977361bde0e42a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1aea7cfc96d8cd1b69e0851a9d28a94b48)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1a34f721af665c6914f264d535be4c6e75)() const` | |
| Public static functions |
| --- |
| `[Max](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1a7f931daaa8cc9bde8743dba94990dbb6)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` |
| `[Min](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1a369524b2414fbb328ecdc511ae07068b)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1aa933d377485c32f11d17f43477f4d172)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1ad43d3560340fe56c700b8e10999ccef3)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args-gradient/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-args-gradient/attrs) | Optional attribute setters for [FakeQuantWithMinMaxArgsGradient](fake-quant-with-min-max-args-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient). |
Public attributes
-----------------
### backprops
```
::tensorflow::Output backprops
```
### operation
```
Operation operation
```
Public functions
----------------
### FakeQuantWithMinMaxArgsGradient
```
FakeQuantWithMinMaxArgsGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input inputs
)
```
### FakeQuantWithMinMaxArgsGradient
```
FakeQuantWithMinMaxArgsGradient(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input inputs,
const FakeQuantWithMinMaxArgsGradient::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Max
```
Attrs Max(
float x
)
```
### Min
```
Attrs Min(
float x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
tensorflow_cpp tensorflow::ops::BatchMatMul tensorflow::ops::BatchMatMul
============================
`#include <math_ops.h>`
Multiplies slices of two tensors in batches.
Summary
-------
Multiplies all slices of `[Tensor](../tensor#classtensorflow_1_1_tensor)``x` and `y` (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the `adj_x` or `adj_y` flag to `True`, which are by default `False`.
The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` and `[..., r_y, c_y]`.
The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:
```
r_o = c_x if adj_x else r_x
c_o = r_y if adj_y else c_y
```
It is computed as:
```
output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: 2-D or higher with shape `[..., r_x, c_x]`.
* y: 2-D or higher with shape `[..., r_y, c_y]`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs)`):
* adj\_x: If `True`, adjoint the slices of `x`. Defaults to `False`.
* adj\_y: If `True`, adjoint the slices of `y`. Defaults to `False`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D or higher with shape `[..., r_o, c_o]`
| Constructors and Destructors |
| --- |
| `[BatchMatMul](#classtensorflow_1_1ops_1_1_batch_mat_mul_1a951cabca8c8dbcf8b746969d80f2b480)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| `[BatchMatMul](#classtensorflow_1_1ops_1_1_batch_mat_mul_1aec4aecf952592bd193eca45a9900ebe1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, const [BatchMatMul::Attrs](../../../struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_batch_mat_mul_1a255c486fdefe3708a3355e3f85e8daf2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_batch_mat_mul_1ad3a290bbf8589298ccf6cd5bf0018a53)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_batch_mat_mul_1af21f279f44b701fb277af586e5f0dd69)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_batch_mat_mul_1aa6685ef6076abe41dc6d4f97156d77cb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_batch_mat_mul_1a7d6d385af7d73a390e36ccc7e6989345)() const` | |
| Public static functions |
| --- |
| `[AdjX](#classtensorflow_1_1ops_1_1_batch_mat_mul_1a47c8466020881eced6720f2f415053dd)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs)` |
| `[AdjY](#classtensorflow_1_1ops_1_1_batch_mat_mul_1a3f939eb8aea098cdf431a3b626274e6b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BatchMatMul::Attrs](../../../struct/tensorflow/ops/batch-mat-mul/attrs) | Optional attribute setters for [BatchMatMul](batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BatchMatMul
```
BatchMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### BatchMatMul
```
BatchMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
const BatchMatMul::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AdjX
```
Attrs AdjX(
bool x
)
```
### AdjY
```
Attrs AdjY(
bool x
)
```
tensorflow_cpp tensorflow::ops::SerializeManySparse tensorflow::ops::SerializeManySparse
====================================
`#include <sparse_ops.h>`
Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]``[Tensor](../tensor#classtensorflow_1_1_tensor)` object.
Summary
-------
The `SparseTensor` must have rank `R` greater than 1, and the first dimension is treated as the minibatch dimension. Elements of the `SparseTensor` must be sorted in increasing order of this first dimension. The serialized `SparseTensor` objects going into each row of `serialized_sparse` will have rank `R-1`.
The minibatch size `N` is extracted from `sparse_shape[0]`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sparse\_indices: 2-D. The `indices` of the minibatch `SparseTensor`.
* sparse\_values: 1-D. The `values` of the minibatch `SparseTensor`.
* sparse\_shape: 1-D. The `shape` of the minibatch `SparseTensor`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/serialize-many-sparse/attrs#structtensorflow_1_1ops_1_1_serialize_many_sparse_1_1_attrs)`):
* out\_type: The `dtype` to use for serialization; the supported types are `string` (default) and `variant`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The serialized\_sparse tensor.
| Constructors and Destructors |
| --- |
| `[SerializeManySparse](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1a8b0ce35d9eb1b1fc37fbe016a56e1d62)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape)` |
| `[SerializeManySparse](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1a9433bfca55151b54355f6be6952584e5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_shape, const [SerializeManySparse::Attrs](../../../struct/tensorflow/ops/serialize-many-sparse/attrs#structtensorflow_1_1ops_1_1_serialize_many_sparse_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1ad0bf6a7b871bfa34f2e3be438f685117)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[serialized\_sparse](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1ad8accf23c3264d678f050a59da40ea64)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1a7739b8a72c33da0538593ca0f83715e9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1a133c0f10bcd9f50787a6e29449ee4654)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1a97858863786b75af5f1b18e86b52470a)() const` | |
| Public static functions |
| --- |
| `[OutType](#classtensorflow_1_1ops_1_1_serialize_many_sparse_1a05cc33d0e457bc120df0e1b365db8ffd)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/serialize-many-sparse/attrs#structtensorflow_1_1ops_1_1_serialize_many_sparse_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SerializeManySparse::Attrs](../../../struct/tensorflow/ops/serialize-many-sparse/attrs) | Optional attribute setters for [SerializeManySparse](serialize-many-sparse#classtensorflow_1_1ops_1_1_serialize_many_sparse). |
Public attributes
-----------------
### operation
```
Operation operation
```
### serialized\_sparse
```
::tensorflow::Output serialized_sparse
```
Public functions
----------------
### SerializeManySparse
```
SerializeManySparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape
)
```
### SerializeManySparse
```
SerializeManySparse(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape,
const SerializeManySparse::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### OutType
```
Attrs OutType(
DataType x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::FloorDiv tensorflow::ops::FloorDiv
=========================
`#include <math_ops.h>`
Returns x // y element-wise.
Summary
-------
*NOTE*: `[FloorDiv](floor-div#classtensorflow_1_1ops_1_1_floor_div)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[FloorDiv](#classtensorflow_1_1ops_1_1_floor_div_1a857dcdccb8b0e2bf92d310fff02412d0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_floor_div_1a852cf5c2ae4c4e4966f045907cc0bd13)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_floor_div_1a151995a60da26c8febff813c256d78cc)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_floor_div_1aacc0b9ec1734f7a30288af8af6a94c08)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_floor_div_1a5d32d0f77f7bf1b635b19eeacb05ed3b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_floor_div_1ae85a4ddc428bca8ffc22896327836d60)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### FloorDiv
```
FloorDiv(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StringSplit tensorflow::ops::StringSplit
============================
`#include <string_ops.h>`
Split elements of `input` based on `delimiter` into a `SparseTensor`.
Summary
-------
Let N be the size of source (typically N will be the batch size). Split each element of `input` based on `delimiter` and return a `SparseTensor` containing the splitted tokens. [Empty](empty#classtensorflow_1_1ops_1_1_empty) tokens are ignored.
`delimiter` can be empty, or a string of split characters. If `delimiter` is an empty string, each element of `input` is split into individual single-byte character strings, including splitting of UTF-8 multibyte sequences. Otherwise every character of `delimiter` is a potential split point.
For example: N = 2, input[0] is 'hello world' and input[1] is 'a b c', then the output will be
indices = [0, 0; 0, 1; 1, 0; 1, 1; 1, 2] shape = [2, 3] values = ['hello', 'world', 'a', 'b', 'c']
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 1-D. Strings to split.
* delimiter: 0-D. Delimiter characters (bytes), or empty string.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs)`):
* skip\_empty: A `bool`. If `True`, skip the empty strings from the result.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` indices: A dense matrix of int64 representing the indices of the sparse tensor.
* `[Output](../output#classtensorflow_1_1_output)` values: A vector of strings corresponding to the splited values.
* `[Output](../output#classtensorflow_1_1_output)` shape: a length-2 vector of int64 representing the shape of the sparse tensor, where the first value is N and the second value is the maximum number of tokens in a single input entry.
| Constructors and Destructors |
| --- |
| `[StringSplit](#classtensorflow_1_1ops_1_1_string_split_1ab3e43561fc94bb0cf1dc324ae780b058)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delimiter)` |
| `[StringSplit](#classtensorflow_1_1ops_1_1_string_split_1aa084e3f7532182e407e239142972f206)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delimiter, const [StringSplit::Attrs](../../../struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[indices](#classtensorflow_1_1ops_1_1_string_split_1ad78d9029594ea73a2d6f82864344d45d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_string_split_1a9f13bcd1e34600b3a8b14445d59142a2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[shape](#classtensorflow_1_1ops_1_1_string_split_1a008b2049c8b2b2c39f057bd4162dc3c2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[values](#classtensorflow_1_1ops_1_1_string_split_1ae71dfe97b78a0999e771725948f9ab04)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[SkipEmpty](#classtensorflow_1_1ops_1_1_string_split_1af6097b372cd021e78a46d3f6076c6745)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/string-split/attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringSplit::Attrs](../../../struct/tensorflow/ops/string-split/attrs) | Optional attribute setters for [StringSplit](string-split#classtensorflow_1_1ops_1_1_string_split). |
Public attributes
-----------------
### indices
```
::tensorflow::Output indices
```
### operation
```
Operation operation
```
### shape
```
::tensorflow::Output shape
```
### values
```
::tensorflow::Output values
```
Public functions
----------------
### StringSplit
```
StringSplit(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input delimiter
)
```
### StringSplit
```
StringSplit(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input delimiter,
const StringSplit::Attrs & attrs
)
```
Public static functions
-----------------------
### SkipEmpty
```
Attrs SkipEmpty(
bool x
)
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyAdadelta tensorflow::ops::ResourceSparseApplyAdadelta
============================================
`#include <training_ops.h>`
var: Should be from a Variable().
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* accum: Should be from a Variable().
* accum\_update: : Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* rho: Decay factor. Must be a scalar.
* epsilon: Constant factor. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyAdadelta](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1ac0369a8a48b24e742fa836599eb174af)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[ResourceSparseApplyAdadelta](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1a9a3ddb8290d6c30f1e25e26f7ba03a0e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [ResourceSparseApplyAdadelta::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1a4e843242aeead4a27df958f70025e05d)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1a334a1a1add4a3894ab372852c319af6d)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1a403257d2f3b607fd2daebf72a0415d8f)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyAdadelta::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adadelta/attrs) | Optional attribute setters for [ResourceSparseApplyAdadelta](resource-sparse-apply-adadelta#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyAdadelta
```
ResourceSparseApplyAdadelta(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input accum_update,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### ResourceSparseApplyAdadelta
```
ResourceSparseApplyAdadelta(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input accum_update,
::tensorflow::Input lr,
::tensorflow::Input rho,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
::tensorflow::Input indices,
const ResourceSparseApplyAdadelta::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Floor tensorflow::ops::Floor
======================
`#include <math_ops.h>`
Returns element-wise largest integer not greater than x.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Floor](#classtensorflow_1_1ops_1_1_floor_1ae230b25651b5115d735b3f2d1e104765)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_floor_1a0707a458d7b7af295c5c7ac638c00ecf)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_floor_1a86c3de24fe14e930f7471c40afd78805)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_floor_1aaa712b53029c2905f2cac385ca6cb1e4)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_floor_1ae04aa6e377cbb887858aaf2c4f14cbe9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_floor_1ab9023c8860d3f03d4cecacb919e5baa2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Floor
```
Floor(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Pad tensorflow::ops::Pad
====================
`#include <array_ops.h>`
Pads a tensor with zeros.
Summary
-------
This operation pads a `input` with zeros according to the `paddings` you specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates how many zeros to add before the contents of `input` in that dimension, and `paddings[D, 1]` indicates how many zeros to add after the contents of `input` in that dimension.
The padded size of each dimension D of the output is:
`paddings(D, 0) + input.dim_size(D) + paddings(D, 1)`
For example:
```
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Pad](#classtensorflow_1_1ops_1_1_pad_1a85413c81814471dc1ba383fffd013f80)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) paddings)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_pad_1a563b99bce289e4fa9fff7224401df773)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_pad_1aa9ec34eb45ae5c727d6bba3e8b51be74)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_pad_1a56e85f7a36d0008faa2e054812438b98)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_pad_1a800a33c0560ed61b5f202d6a5aaf4ca9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_pad_1a177bc15a4ed8369a6438d47130f9ac27)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Pad
```
Pad(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input paddings
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::StringStrip tensorflow::ops::StringStrip
============================
`#include <string_ops.h>`
Strip leading and trailing whitespaces from the [Tensor](../tensor#classtensorflow_1_1_tensor).
Summary
-------
Examples:
tf.strings.strip(["\\nTensorFlow", " The python library "]).numpy() array([b'TensorFlow', b'The python library'], dtype=object)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: A string `[Tensor](../tensor#classtensorflow_1_1_tensor)` of any shape.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A string `[Tensor](../tensor#classtensorflow_1_1_tensor)` of the same shape as the input.
| Constructors and Destructors |
| --- |
| `[StringStrip](#classtensorflow_1_1ops_1_1_string_strip_1a0d346f7d1a699725f37ddb58375eb37a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_strip_1a6969e477b11ca39f71a21ae5f006cc7e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_strip_1a28427413e62484b63aeee55a509f19b2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_strip_1a2fd6ef98ae9fa8b948636eab9423c419)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_strip_1a60f09cee4031c28f02d5683d231b6c99)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_strip_1a65ed73f97ac9b81049cada72dbb19118)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringStrip
```
StringStrip(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::FixedUnigramCandidateSampler tensorflow::ops::FixedUnigramCandidateSampler
=============================================
`#include <candidate_sampling_ops.h>`
Generates labels for candidate sampling with a learned unigram distribution.
Summary
-------
A unigram sampler could use a fixed unigram distribution read from a file or passed in as an in-memory array instead of building up the distribution from data on the fly. There is also an option to skew the distribution by applying a distortion power to the weights.
The vocabulary file should be in CSV-like format, with the last field being the weight associated with the word.
For each batch, this op picks a single set of sampled candidate labels.
The advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* true\_classes: A batch\_size \* num\_true matrix, in which each row contains the IDs of the num\_true target\_classes in the corresponding original label.
* num\_true: Number of true labels per context.
* num\_sampled: Number of candidates to randomly sample.
* unique: If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.
* range\_max: The sampler will sample integers from the interval [0, range\_max).
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)`):
* vocab\_file: Each valid line in this file (which should have a CSV-like format) corresponds to a valid word ID. IDs are in sequential order, starting from num\_reserved\_ids. The last entry in each line is expected to be a value corresponding to the count or relative probability. Exactly one of vocab\_file and unigrams needs to be passed to this op.
* distortion: The distortion is used to skew the unigram probability distribution. Each weight is first raised to the distortion's power before adding to the internal unigram distribution. As a result, distortion = 1.0 gives regular unigram sampling (as defined by the vocab file), and distortion = 0.0 gives a uniform distribution.
* num\_reserved\_ids: Optionally some reserved IDs can be added in the range [0, ..., num\_reserved\_ids) by the users. One use case is that a special unknown word token is used as ID 0. These IDs will have a sampling probability of 0.
* num\_shards: A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. This parameter (together with 'shard') indicates the number of partitions that are being used in the overall computation.
* shard: A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. This parameter (together with 'num\_shards') indicates the particular partition number of a sampler op, when partitioning is being used.
* unigrams: A list of unigram counts or probabilities, one per ID in sequential order. Exactly one of vocab\_file and unigrams should be passed to this op.
* seed: If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sampled\_candidates: A vector of length num\_sampled, in which each element is the ID of a sampled candidate.
* `[Output](../output#classtensorflow_1_1_output)` true\_expected\_count: A batch\_size \* num\_true matrix, representing the number of times each candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
* `[Output](../output#classtensorflow_1_1_output)` sampled\_expected\_count: A vector of length num\_sampled, for each sampled candidate representing the number of times the candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.
| Constructors and Destructors |
| --- |
| `[FixedUnigramCandidateSampler](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1ae8c5618853053ddb07df8982d3db9327)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)` |
| `[FixedUnigramCandidateSampler](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1ab56fd2736f195648745fed0061bc25be)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const [FixedUnigramCandidateSampler::Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1a6737b87156420b7e83c7dca7f6e81019)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sampled\_candidates](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1af1016a613f8a28d9d2613f29877660ba)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sampled\_expected\_count](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1ad15252f0fcc49c397345bdffc41a8d50)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[true\_expected\_count](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1acba8e1bae0c35b34017845b51a9fe0d8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Distortion](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1a4be4a6f8d04c1cc86d55e8941c39da12)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[NumReservedIds](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1ade1a5a515dbc188fd7441ddece3083c3)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[NumShards](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1a9be04a2d9172e6c88d98476d69f1d550)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[Seed](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1af0e1d93bd6b5b0bfe14e2b8de344ecd4)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1ac7233d8f8b3b2bcf6b7f6608d263ed6f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[Shard](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1aed61ff942cd8963e75be86bc143a4f14)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[Unigrams](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1a3b4b41c711e53ac94ceb79eaa71a4469)(const gtl::ArraySlice< float > & x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| `[VocabFile](#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1aadd26dbfeb42d1a0b9d5f0075da6779e)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FixedUnigramCandidateSampler::Attrs](../../../struct/tensorflow/ops/fixed-unigram-candidate-sampler/attrs) | Optional attribute setters for [FixedUnigramCandidateSampler](fixed-unigram-candidate-sampler#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sampled\_candidates
```
::tensorflow::Output sampled_candidates
```
### sampled\_expected\_count
```
::tensorflow::Output sampled_expected_count
```
### true\_expected\_count
```
::tensorflow::Output true_expected_count
```
Public functions
----------------
### FixedUnigramCandidateSampler
```
FixedUnigramCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max
)
```
### FixedUnigramCandidateSampler
```
FixedUnigramCandidateSampler(
const ::tensorflow::Scope & scope,
::tensorflow::Input true_classes,
int64 num_true,
int64 num_sampled,
bool unique,
int64 range_max,
const FixedUnigramCandidateSampler::Attrs & attrs
)
```
Public static functions
-----------------------
### Distortion
```
Attrs Distortion(
float x
)
```
### NumReservedIds
```
Attrs NumReservedIds(
int64 x
)
```
### NumShards
```
Attrs NumShards(
int64 x
)
```
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
### Shard
```
Attrs Shard(
int64 x
)
```
### Unigrams
```
Attrs Unigrams(
const gtl::ArraySlice< float > & x
)
```
### VocabFile
```
Attrs VocabFile(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::BatchMatMulV2 tensorflow::ops::BatchMatMulV2
==============================
`#include <math_ops.h>`
Multiplies slices of two tensors in batches.
Summary
-------
Multiplies all slices of `[Tensor](../tensor#classtensorflow_1_1_tensor)``x` and `y` (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the `adj_x` or `adj_y` flag to `True`, which are by default `False`.
The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` and `[..., r_y, c_y]`.
The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:
```
r_o = c_x if adj_x else r_x
c_o = r_y if adj_y else c_y
```
It is computed as:
```
output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
```
*NOTE*: `[BatchMatMulV2](batch-mat-mul-v2#classtensorflow_1_1ops_1_1_batch_mat_mul_v2)` supports broadcasting in the batch dimensions. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: 2-D or higher with shape `[..., r_x, c_x]`.
* y: 2-D or higher with shape `[..., r_y, c_y]`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v2/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs)`):
* adj\_x: If `True`, adjoint the slices of `x`. Defaults to `False`.
* adj\_y: If `True`, adjoint the slices of `y`. Defaults to `False`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D or higher with shape `[..., r_o, c_o]`
| Constructors and Destructors |
| --- |
| `[BatchMatMulV2](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a72c2f4ad83e7c11063fadaf661ec6d54)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| `[BatchMatMulV2](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a6990e4599f21b54bb5f18572d215fcb1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, const [BatchMatMulV2::Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v2/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a6b83c78f1764f9f38262039680f75f48)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1ac477c6e218d7285987ba896599db161e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a11c6e4f79b4fbd6ce36ecbc3c84c1e6e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1af48144aa8d3a20f660281a87abccb7b8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a807920b129cb268198f13fa48d55d9b7)() const` | |
| Public static functions |
| --- |
| `[AdjX](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a8f28eaff740f7852929cd5e69f82196d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v2/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs)` |
| `[AdjY](#classtensorflow_1_1ops_1_1_batch_mat_mul_v2_1a76e0c3ea406e4d375518505611ff3358)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v2/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BatchMatMulV2::Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v2/attrs) | Optional attribute setters for [BatchMatMulV2](batch-mat-mul-v2#classtensorflow_1_1ops_1_1_batch_mat_mul_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BatchMatMulV2
```
BatchMatMulV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### BatchMatMulV2
```
BatchMatMulV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
const BatchMatMulV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AdjX
```
Attrs AdjX(
bool x
)
```
### AdjY
```
Attrs AdjY(
bool x
)
```
tensorflow_cpp tensorflow::ops::SetDiff1D tensorflow::ops::SetDiff1D
==========================
`#include <array_ops.h>`
Computes the difference between two lists of numbers or strings.
Summary
-------
Given a list `x` and a list `y`, this operation returns a list `out` that represents all values that are in `x` but not in `y`. The returned list `out` is sorted in the same order that the numbers appear in `x` (duplicates are preserved). This operation also returns a list `idx` that represents the position of each `out` element in `x`. In other words:
`out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]`
For example, given this input:
```
x = [1, 2, 3, 4, 5, 6]
y = [1, 3, 5]
```
This operation would return:
```
out ==> [2, 4, 6]
idx ==> [1, 3, 5]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: 1-D. Values to keep.
* y: 1-D. Values to remove.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` out: 1-D. Values present in `x` but not in `y`.
* `[Output](../output#classtensorflow_1_1_output)` idx: 1-D. Positions of `x` values preserved in `out`.
| Constructors and Destructors |
| --- |
| `[SetDiff1D](#classtensorflow_1_1ops_1_1_set_diff1_d_1a6710b0de19cc8ed8db1fd0affa254ef2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| `[SetDiff1D](#classtensorflow_1_1ops_1_1_set_diff1_d_1ab8dc6a2fee78ba148fd712ea5d8b54c5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, const [SetDiff1D::Attrs](../../../struct/tensorflow/ops/set-diff1-d/attrs#structtensorflow_1_1ops_1_1_set_diff1_d_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[idx](#classtensorflow_1_1ops_1_1_set_diff1_d_1a7a2e1946513c22df219161e501162ab0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_set_diff1_d_1a1339e3af48083e545565ddaa7b259eb8)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_set_diff1_d_1a9ce116feeef14a58ab2608142f3b632b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[OutIdx](#classtensorflow_1_1ops_1_1_set_diff1_d_1aa928e875080781e6e3d4fd2e82eca555)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/set-diff1-d/attrs#structtensorflow_1_1ops_1_1_set_diff1_d_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SetDiff1D::Attrs](../../../struct/tensorflow/ops/set-diff1-d/attrs) | Optional attribute setters for [SetDiff1D](set-diff1-d#classtensorflow_1_1ops_1_1_set_diff1_d). |
Public attributes
-----------------
### idx
```
::tensorflow::Output idx
```
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SetDiff1D
```
SetDiff1D(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### SetDiff1D
```
SetDiff1D(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
const SetDiff1D::Attrs & attrs
)
```
Public static functions
-----------------------
### OutIdx
```
Attrs OutIdx(
DataType x
)
```
tensorflow_cpp tensorflow::ops::TakeManySparseFromTensorsMap tensorflow::ops::TakeManySparseFromTensorsMap
=============================================
`#include <sparse_ops.h>`
Converts a sparse representation into a dense tensor.
Summary
-------
Builds an array `dense` with shape `output_shape` such that
If sparse\_indices is scalar
============================
dense[i] = (i == sparse\_indices ? sparse\_values : default\_value)
If sparse\_indices is a vector, then for each i
===============================================
dense[sparse\_indices[i]] = sparse\_values[i]
If sparse\_indices is an n by d matrix, then for each i in [0, n)
=================================================================
dense[sparse\_indices[i][0], ..., sparse\_indices[i][d-1]] = sparse\_values[i]
```
All other values in `dense` are set to `default_value`. If `sparse_values` is a
scalar, all sparse indices are set to this single value.
```
```
Indices should be sorted in lexicographic order, and indices must not
contain any repeats. If `validate_indices` is true, these properties
are checked during execution.
```
```
Args:
* scope: A Scope object
* sparse_indices: 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete
index where `sparse_values[i]` will be placed.
* output_shape: 1-D. Shape of the dense output tensor.
* sparse_values: 1-D. Values corresponding to each row of `sparse_indices`,
or a scalar value to be used for all sparse indices.
* default_value: Scalar value to set for indices not specified in
`sparse_indices`.
```
```
Optional attributes (see `Attrs`):
* validate_indices: If true, indices are checked to make sure they are sorted in
lexicographic order and that there are no repeats.
```
```
Returns:
* `Output`: Dense output tensor of shape `output_shape`. */
class SparseToDense {
public:
/// Optional attribute setters for SparseToDense
struct Attrs {
/** If true, indices are checked to make sure they are sorted in
lexicographic order and that there are no repeats.
```
```
Defaults to true */
TF_MUST_USE_RESULT Attrs ValidateIndices(bool x) {
Attrs ret = *this;
ret.validate_indices_ = x;
return ret;
}
```
```
bool validate_indices_ = true;
};
SparseToDense(const tensorflow::Scope& scope, tensorflow::Input
sparse_indices, tensorflow::Input output_shape,
tensorflow::Input sparse_values, tensorflow::Input
default_value);
SparseToDense(const tensorflow::Scope& scope, tensorflow::Input
sparse_indices, tensorflow::Input output_shape,
tensorflow::Input sparse_values, tensorflow::Input
default_value, const SparseToDense::Attrs& attrs);
operator ::tensorflow::Output() const { return dense; }
operator ::tensorflow::Input() const { return dense; }
::tensorflow::Node* node() const { return dense.node(); }
```
```
static Attrs ValidateIndices(bool x) {
return Attrs().ValidateIndices(x);
}
```
```
Operation operation;
tensorflow::Output dense;
};
```
```
/** Read `SparseTensors` from a `SparseTensorsMap` and concatenate them.
```
```
The input `sparse_handles` must be an `int64` matrix of shape `[N, 1]` where
`N` is the minibatch size and the rows correspond to the output handles of
`AddSparseToTensorsMap` or `AddManySparseToTensorsMap`. The ranks of the
original `SparseTensor` objects that went into the given input ops must all
match. When the final `SparseTensor` is created, it has rank one
higher than the ranks of the incoming `SparseTensor` objects
(they have been concatenated along a new row dimension on the left).
```
```
The output `SparseTensor` object's shape values for all dimensions but the
first are the max across the input `SparseTensor` objects' shape values
for the corresponding dimensions. Its first shape value is `N`, the minibatch
size.
```
```
The input `SparseTensor` objects' indices are assumed ordered in
standard lexicographic order. If this is not the case, after this
step run `SparseReorder` to restore index ordering.
```
```
For example, if the handles represent an input, which is a `[2, 3]` matrix
representing two original `SparseTensor` objects:
```
index = [ 0] [10] [20] values = [1, 2, 3] shape = [50]
```
and
```
index = [ 2] [10] values = [4, 5] shape = [30]
```
then the final `SparseTensor` will be:
```
index = [0 0] [0 10] [0 20] [1 2] [1 10] values = [1, 2, 3, 4, 5] shape = [2 50] ``` Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sparse\_handles: 1-D, The `N` serialized `SparseTensor` objects. Shape: `[N]`.
* dtype: The `dtype` of the `SparseTensor` objects stored in the `SparseTensorsMap`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/take-many-sparse-from-tensors-map/attrs#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs)`):
* container: The container name for the `SparseTensorsMap` read by this op.
* shared\_name: The shared name for the `SparseTensorsMap` read by this op. It should not be blank; rather the `shared_name` or unique [Operation](../operation#classtensorflow_1_1_operation) name of the Op that created the original `SparseTensorsMap` should be used.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` sparse\_indices: 2-D. The `indices` of the minibatch `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` sparse\_values: 1-D. The `values` of the minibatch `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` sparse\_shape: 1-D. The `shape` of the minibatch `SparseTensor`.
| Constructors and Destructors |
| --- |
| `[TakeManySparseFromTensorsMap](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a83e35de64de0efe9f8dde569c0f07c19)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_handles, DataType dtype)` |
| `[TakeManySparseFromTensorsMap](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a41a02ee43f2ac5b803bfaf422e93996c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sparse_handles, DataType dtype, const [TakeManySparseFromTensorsMap::Attrs](../../../struct/tensorflow/ops/take-many-sparse-from-tensors-map/attrs#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a9e44ee5dfd10ac82974527c4f79e72f4)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sparse\_indices](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a2bf4dc72b65cf3aba1bb9d9da37e0d75)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sparse\_shape](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a2bc04b48df2df2f26a1d9457b99e824d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[sparse\_values](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a13b416e0f903165522e36315dab400c4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Container](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1adba16ce7b05be3dc85601cd7cce43cb2)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/take-many-sparse-from-tensors-map/attrs#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1a3b66a348014e00a092326b498128eb35)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/take-many-sparse-from-tensors-map/attrs#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::TakeManySparseFromTensorsMap::Attrs](../../../struct/tensorflow/ops/take-many-sparse-from-tensors-map/attrs) | Optional attribute setters for [TakeManySparseFromTensorsMap](take-many-sparse-from-tensors-map#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map). |
Public attributes
-----------------
### operation
```
Operation operation
```
### sparse\_indices
```
::tensorflow::Output sparse_indices
```
### sparse\_shape
```
::tensorflow::Output sparse_shape
```
### sparse\_values
```
::tensorflow::Output sparse_values
```
Public functions
----------------
### TakeManySparseFromTensorsMap
```
TakeManySparseFromTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_handles,
DataType dtype
)
```
### TakeManySparseFromTensorsMap
```
TakeManySparseFromTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_handles,
DataType dtype,
const TakeManySparseFromTensorsMap::Attrs & attrs
)
```
Public static functions
-----------------------
### Container
```
Attrs Container(
StringPiece x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Erfc tensorflow::ops::Erfc
=====================
`#include <math_ops.h>`
Computes the complementary error function of `x` element-wise.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Erfc](#classtensorflow_1_1ops_1_1_erfc_1a062cdd852bbbe669f178ed79716ab585)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_erfc_1af28d19649fcac41a3a15f034141f3640)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_erfc_1a324dfdf0b35a97d13399b397c5a36054)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_erfc_1a3aafc8832a997a84ef29714706fe5384)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_erfc_1a36680b87be9a77ccbd6e894950c33c41)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_erfc_1a222b996d55f0e10923f96ad7381ae43d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Erfc
```
Erfc(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DecodeJSONExample tensorflow::ops::DecodeJSONExample
==================================
`#include <parsing_ops.h>`
Convert JSON-encoded Example records to binary protocol buffer strings.
Summary
-------
Note: This is **not** a general purpose JSON parsing op.
This op converts JSON-serialized `tf.train.Example` (created with `json_format.MessageToJson`, following the [standard JSON mapping](https://developers.google.com/protocol-buffers/docs/proto3#json)) to a binary-serialized `tf.train.Example` (equivalent to `Example.SerializeToString()`) suitable for conversion to tensors with `tf.io.parse_example`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* json\_examples: Each string is a JSON object serialized according to the JSON mapping of the Example proto.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Each string is a binary Example protocol buffer corresponding to the respective element of `json_examples`.
| Constructors and Destructors |
| --- |
| `[DecodeJSONExample](#classtensorflow_1_1ops_1_1_decode_j_s_o_n_example_1a5175fd5db2a3e172a06516fec3850efc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) json_examples)` |
| Public attributes |
| --- |
| `[binary\_examples](#classtensorflow_1_1ops_1_1_decode_j_s_o_n_example_1ac6b3c22f94a224fac5ebd77479234283)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_decode_j_s_o_n_example_1aa94b74db4f2eca6c04a386e5c8174a04)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_decode_j_s_o_n_example_1a92b8985bc289f541f6e6b6c22385977d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_j_s_o_n_example_1acc4b898745eafcad0baf530183ec33c8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_j_s_o_n_example_1afc1fcbf55494127f3107e7901ebec32a)() const` | |
Public attributes
-----------------
### binary\_examples
```
::tensorflow::Output binary_examples
```
### operation
```
Operation operation
```
Public functions
----------------
### DecodeJSONExample
```
DecodeJSONExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input json_examples
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Concat tensorflow::ops::Concat
=======================
`#include <array_ops.h>`
Concatenates tensors along one dimension.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* values: List of `N` Tensors to concatenate. Their ranks and types must match, and their sizes must match in all dimensions except `concat_dim`.
* axis: 0-D. The dimension along which to concatenate. Must be in the range [-rank(values), rank(values)).
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the concatenation of values stacked along the `concat_dim` dimension. This tensor's shape matches that of `values` except in `concat_dim` where it has the sum of the sizes.
| Constructors and Destructors |
| --- |
| `[Concat](#classtensorflow_1_1ops_1_1_concat_1aaa84b56305f5680546c7e6d798ae937e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_concat_1ae9307593f77cf5273d28e47cd31d2f83)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_concat_1ac015eeead9d68cfc3c5b71b3c8223df4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_concat_1a72378c0bf5ed076831238d92d7fbfb02)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_concat_1afd6351cffb163f71f2cf8742b0531045)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_concat_1a59af68501204ea494fb84bec67889b2d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Concat
```
Concat(
const ::tensorflow::Scope & scope,
::tensorflow::InputList values,
::tensorflow::Input axis
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseSliceGrad tensorflow::ops::SparseSliceGrad
================================
`#include <sparse_ops.h>`
The gradient operator for the [SparseSlice](sparse-slice#classtensorflow_1_1ops_1_1_sparse_slice) op.
Summary
-------
This op takes in the upstream gradient w.r.t. non-empty values of the sliced `SparseTensor`, and outputs the gradients w.r.t. the non-empty values of input `SparseTensor`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* backprop\_val\_grad: 1-D. The gradient with respect to the non-empty values of the sliced `SparseTensor`.
* input\_indices: 2-D. The `indices` of the input `SparseTensor`.
* input\_start: 1-D. tensor represents the start of the slice.
* output\_indices: 2-D. The `indices` of the sliced `SparseTensor`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D. The gradient with respect to the non-empty values of input `SparseTensor`.
| Constructors and Destructors |
| --- |
| `[SparseSliceGrad](#classtensorflow_1_1ops_1_1_sparse_slice_grad_1a61a49266ea8096f01fa4aa844f1c75c3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) backprop_val_grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_start, ::[tensorflow::Input](../input#classtensorflow_1_1_input) output_indices)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_slice_grad_1adfc057ace318022b3bee9cd07bd6f835)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[val\_grad](#classtensorflow_1_1ops_1_1_sparse_slice_grad_1a1674c7bc87e5fec3efd3085e2daa7ca3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_slice_grad_1ababeb6aceed2c9b368b9b79983a1fe7f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_slice_grad_1a98c6cf59f7806750cf8dc6e8fa5c6f7f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_slice_grad_1aff4fc14838514fb7e2de68eea849d589)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### val\_grad
```
::tensorflow::Output val_grad
```
Public functions
----------------
### SparseSliceGrad
```
SparseSliceGrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input backprop_val_grad,
::tensorflow::Input input_indices,
::tensorflow::Input input_start,
::tensorflow::Input output_indices
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApplyProximalAdagrad tensorflow::ops::ApplyProximalAdagrad
=====================================
`#include <training_ops.h>`
Update '\*var' and '\*accum' according to FOBOS with Adagrad learning rate.
Summary
-------
accum += grad \* grad prox\_v = var - lr \* grad \* (1 / sqrt(accum)) var = sign(prox\_v)/(1+lr\*l2) \* max{|prox\_v|-lr\*l1,0}
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_proximal_adagrad_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[ApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1ad631e66a4af770b5e290d54095645039)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1a6197e139173a7abb3bda5dc8cd631cc4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_proximal_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1aab516e6991e64c35481834487b8d2203)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1a53cf9fc743a8b5c317066ce86c2cff4e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1a6485f5175e0c9a32f3ea0a5ca9997bfa)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1aaa631be6296658ab1f47f52b03291167)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1a1727266f9db90b1162fda6fe029cd841)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_apply_proximal_adagrad_1aa609b5e5be60876afadb978635de3737)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_apply_proximal_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/apply-proximal-adagrad/attrs) | Optional attribute setters for [ApplyProximalAdagrad](apply-proximal-adagrad#classtensorflow_1_1ops_1_1_apply_proximal_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### ApplyProximalAdagrad
```
ApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad
)
```
### ApplyProximalAdagrad
```
ApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
const ApplyProximalAdagrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::GreaterEqual tensorflow::ops::GreaterEqual
=============================
`#include <math_ops.h>`
Returns the truth value of (x >= y) element-wise.
Summary
-------
*NOTE*: `[GreaterEqual](greater-equal#classtensorflow_1_1ops_1_1_greater_equal)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Example:
```
x = tf.constant([5, 4, 6, 7])
y = tf.constant([5, 2, 5, 10])
tf.math.greater_equal(x, y) ==> [True, True, True, False]
```
```
x = tf.constant([5, 4, 6, 7])
y = tf.constant([5])
tf.math.greater_equal(x, y) ==> [True, False, True, True]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[GreaterEqual](#classtensorflow_1_1ops_1_1_greater_equal_1a422da01235997e35361cdeadacfcb858)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_greater_equal_1ad9d8524d31876937cdc925404beb421a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_greater_equal_1a98fa5c18f2339bf35bcf89b4a579abb8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_greater_equal_1ac3af218d4a06bf958ad92483f2a4d552)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_greater_equal_1a3831b838de787044ec4c0c4dd06a5ef9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_greater_equal_1ac818bdc95a7eed0f193f3a1d050bc4ab)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### GreaterEqual
```
GreaterEqual(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::GatherV2 tensorflow::ops::GatherV2
=========================
`#include <array_ops.h>`
[Gather](gather#classtensorflow_1_1ops_1_1_gather) slices from `params` axis `axis` according to `indices`.
Summary
-------
`indices` must be an integer tensor of any dimension (usually 0-D or 1-D). Produces an output tensor with shape `params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:]` where:
```
# Scalar indices (output is rank(params) - 1).
output[a_0, ..., a_n, b_0, ..., b_n] =
params[a_0, ..., a_n, indices, b_0, ..., b_n]
```
```
# Vector indices (output is rank(params)).
output[a_0, ..., a_n, i, b_0, ..., b_n] =
params[a_0, ..., a_n, indices[i], b_0, ..., b_n]
```
```
# Higher rank indices (output is rank(params) + rank(indices) - 1).
output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]
```

Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, a 0 is stored in the corresponding output value.
See also `tf.batch_gather` and `tf.gather_nd`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* params: The tensor from which to gather values. Must be at least rank `axis + 1`.
* indices: Index tensor. Must be in range `[0, params.shape[axis])`.
* axis: The axis in `params` to gather `indices` from. Defaults to the first dimension. Supports negative indexes.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Values from `params` gathered from indices given by `indices`, with shape `params.shape[:axis] + indices.shape + params.shape[axis + 1:]`.
| Constructors and Destructors |
| --- |
| `[GatherV2](#classtensorflow_1_1ops_1_1_gather_v2_1afff9f85abc36b6134f07ac9264e6b6b7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) params, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` |
| `[GatherV2](#classtensorflow_1_1ops_1_1_gather_v2_1a8f8e2e0c5f4693b13f8a2c747ff77d8b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) params, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [GatherV2::Attrs](../../../struct/tensorflow/ops/gather-v2/attrs#structtensorflow_1_1ops_1_1_gather_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_gather_v2_1acada34664fa1ed40763d7823796966d3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_gather_v2_1a8d4dd95b0f18afade1621c680ecdac1a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_gather_v2_1abc465824a7b865f5bdfa41eb624a1bb7)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_gather_v2_1a967966fdcae665e9578c3e9512e18b4c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_gather_v2_1a5f58668891b9a0ae4a460fe84c7b4d5c)() const` | |
| Public static functions |
| --- |
| `[BatchDims](#classtensorflow_1_1ops_1_1_gather_v2_1a96a2555cae1e27560651b09777fece7c)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/gather-v2/attrs#structtensorflow_1_1ops_1_1_gather_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::GatherV2::Attrs](../../../struct/tensorflow/ops/gather-v2/attrs) | Optional attribute setters for [GatherV2](gather-v2#classtensorflow_1_1ops_1_1_gather_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### GatherV2
```
GatherV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input params,
::tensorflow::Input indices,
::tensorflow::Input axis
)
```
### GatherV2
```
GatherV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input params,
::tensorflow::Input indices,
::tensorflow::Input axis,
const GatherV2::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### BatchDims
```
Attrs BatchDims(
int64 x
)
```
tensorflow_cpp tensorflow::ops::NonMaxSuppressionWithOverlaps tensorflow::ops::NonMaxSuppressionWithOverlaps
==============================================
`#include <image_ops.h>`
Greedily selects a subset of bounding boxes in descending order of score,.
Summary
-------
pruning away boxes that have high overlaps with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. N-by-n overlap values are supplied as square matrix, which allows for defining a custom overlap criterium (eg. intersection over union, intersection over area, etc.).
The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example:
selected\_indices = tf.image.non\_max\_suppression\_with\_overlaps( overlaps, scores, max\_output\_size, overlap\_threshold, score\_threshold) selected\_boxes = tf.gather(boxes, selected\_indices)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* overlaps: A 2-D float tensor of shape `[num_boxes, num_boxes]` representing the n-by-n box overlap values.
* scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).
* max\_output\_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
* overlap\_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too.
* score\_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
| Constructors and Destructors |
| --- |
| `[NonMaxSuppressionWithOverlaps](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1af965488437d8cbc7c79e1c36eca2abb3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) overlaps, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) overlap_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a2f05b95bdafce0c5fc4a8269b35709e3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[selected\_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1ab9ac497f027b7104d8ba5463a5a487ca)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a77c8843216c117ea9cc2597027f4a20e)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a46f0366220ce965998602e5248c93070)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_with_overlaps_1a636de2d3e1a950d52efadd9bff02eb59)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### selected\_indices
```
::tensorflow::Output selected_indices
```
Public functions
----------------
### NonMaxSuppressionWithOverlaps
```
NonMaxSuppressionWithOverlaps(
const ::tensorflow::Scope & scope,
::tensorflow::Input overlaps,
::tensorflow::Input scores,
::tensorflow::Input max_output_size,
::tensorflow::Input overlap_threshold,
::tensorflow::Input score_threshold
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::InplaceAdd tensorflow::ops::InplaceAdd
===========================
`#include <array_ops.h>`
Adds v into specified rows of x.
Summary
-------
Computes y = x; y[i, :] += v; return y.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T.
* i: A vector. Indices into the left-most dimension of `x`.
* v: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`.
| Constructors and Destructors |
| --- |
| `[InplaceAdd](#classtensorflow_1_1ops_1_1_inplace_add_1a69ca44fb5c09a80cd460a48e5cca65e7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) i, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_inplace_add_1a6791f685a621f7ec8d3742bad9b3ef35)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_inplace_add_1a7da39b5f9e8133f5017e51f207ca9876)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_inplace_add_1a02fe436ff3082e9021a332d29062c473)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_inplace_add_1a5f0cf64af4d0b04bc06cae9dad77369a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_inplace_add_1a13d1d085ff534e56a8adf5c75e610b13)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### InplaceAdd
```
InplaceAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input i,
::tensorflow::Input v
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Substr tensorflow::ops::Substr
=======================
`#include <string_ops.h>`
Return substrings from `[Tensor](../tensor#classtensorflow_1_1_tensor)` of strings.
Summary
-------
For each string in the input `[Tensor](../tensor#classtensorflow_1_1_tensor)`, creates a substring starting at index `pos` with a total length of `len`.
If `len` defines a substring that would extend beyond the length of the input string, or if `len` is negative, then as many characters as possible are used.
A negative `pos` indicates distance within the string backwards from the end.
If `pos` specifies an index which is out of range for any of the input strings, then an `InvalidArgumentError` is thrown.
`pos` and `len` must have the same shape, otherwise a `ValueError` is thrown on Op creation.
*NOTE*: `[Substr](substr#classtensorflow_1_1ops_1_1_substr)` supports broadcasting up to two dimensions. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Examples
Using scalar `pos` and `len`:
```
input = [b'Hello', b'World']
position = 1
length = 3
```
```
output = [b'ell', b'orl']
```
Using `pos` and `len` with same shape as `input`:
```
input = [[b'ten', b'eleven', b'twelve'],
[b'thirteen', b'fourteen', b'fifteen'],
[b'sixteen', b'seventeen', b'eighteen']]
position = [[1, 2, 3],
[1, 2, 3],
[1, 2, 3]]
length = [[2, 3, 4],
[4, 3, 2],
[5, 5, 5]]
```
```
output = [[b'en', b'eve', b'lve'],
[b'hirt', b'urt', b'te'],
[b'ixtee', b'vente', b'hteen']]
```
Broadcasting `pos` and `len` onto `input`:
```
input = [[b'ten', b'eleven', b'twelve'],
[b'thirteen', b'fourteen', b'fifteen'],
[b'sixteen', b'seventeen', b'eighteen'],
[b'nineteen', b'twenty', b'twentyone']]
position = [1, 2, 3]
length = [1, 2, 3]
```
```
output = [[b'e', b'ev', b'lve'],
[b'h', b'ur', b'tee'],
[b'i', b've', b'hte'],
[b'i', b'en', b'nty']]
```
Broadcasting `input` onto `pos` and `len`:
```
input = b'thirteen'
position = [1, 5, 7]
length = [3, 2, 1]
```
```
output = [b'hir', b'ee', b'n']
```
Raises:
* `ValueError`: If the first argument cannot be converted to a [Tensor](../tensor#classtensorflow_1_1_tensor) of `dtype string`.
* `InvalidArgumentError`: If indices are out of range.
* `ValueError`: If `pos` and `len` are not the same shape.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: [Tensor](../tensor#classtensorflow_1_1_tensor) of strings
* pos: Scalar defining the position of first character in each substring
* len: Scalar defining the number of characters to include in each substring
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/substr/attrs#structtensorflow_1_1ops_1_1_substr_1_1_attrs)`):
* unit: The unit that is used to create the substring. One of: `"BYTE"` (for defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 encoded Unicode code points). The default is `"BYTE"`. Results are undefined if `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid UTF-8.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: [Tensor](../tensor#classtensorflow_1_1_tensor) of substrings
| Constructors and Destructors |
| --- |
| `[Substr](#classtensorflow_1_1ops_1_1_substr_1ac4ec231f379a3a957a1ba6c388900d2e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pos, ::[tensorflow::Input](../input#classtensorflow_1_1_input) len)` |
| `[Substr](#classtensorflow_1_1ops_1_1_substr_1ad8326181a5399cf82aef5d7e4d9b925b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pos, ::[tensorflow::Input](../input#classtensorflow_1_1_input) len, const [Substr::Attrs](../../../struct/tensorflow/ops/substr/attrs#structtensorflow_1_1ops_1_1_substr_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_substr_1a5cebdcec605f165be72c6ccb0b0a7b6c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_substr_1a833ab93a8bd8153ad683227af6205edd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_substr_1a3a2b4eaf7158fcdda9d4b5e3012ed9c0)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_substr_1ae833d53311bfbb74a3c86b93f99c5027)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_substr_1a001cd1f5803fc422a0b6fa274ca5b0eb)() const` | |
| Public static functions |
| --- |
| `[Unit](#classtensorflow_1_1ops_1_1_substr_1a5ab53f27d3a07b25ad2b97cbaaa7747f)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/substr/attrs#structtensorflow_1_1ops_1_1_substr_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Substr::Attrs](../../../struct/tensorflow/ops/substr/attrs) | Optional attribute setters for [Substr](substr#classtensorflow_1_1ops_1_1_substr). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Substr
```
Substr(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input pos,
::tensorflow::Input len
)
```
### Substr
```
Substr(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input pos,
::tensorflow::Input len,
const Substr::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Unit
```
Attrs Unit(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Conv2DBackpropFilter tensorflow::ops::Conv2DBackpropFilter
=====================================
`#include <nn_ops.h>`
Computes the gradients of convolution with respect to the filter.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: 4-D with shape `[batch, in_height, in_width, in_channels]`.
* filter\_sizes: An integer vector representing the tensor shape of `filter`, where `filter` is a 4-D `[filter_height, filter_width, in_channels, out_channels]` tensor.
* out\_backprop: 4-D with shape `[batch, out_height, out_width, out_channels]`. Gradients w.r.t. the output of the convolution.
* strides: The stride of the sliding window for each dimension of the input of the convolution. Must be in the same order as the dimension specified with format.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)`):
* explicit\_paddings: If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty.
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width].
* dilations: 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. the `filter` input of the convolution.
| Constructors and Destructors |
| --- |
| `[Conv2DBackpropFilter](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a799b52a54b6ed6387afe8c2147aff0da)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[Conv2DBackpropFilter](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a7bec0a5bc85d2c452e02c02feaa30bec)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filter_sizes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) out_backprop, const gtl::ArraySlice< int > & strides, StringPiece padding, const [Conv2DBackpropFilter::Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a627aac02d2a36f95929e36f2027c8672)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1aefc74eafda94631873fa7b35fb79bb9c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1aaae19666c83ef2abfd5d2b10b9cc1b79)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a24db1aa2b5b3fb8b00b8939b1708eb9c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a6cd0bf5f17fa87c8a484ea9288ce4a05)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a67e760b8ede5ea02dac7dee92c21a4c7)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` |
| `[Dilations](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1aa2179fd147f84ae7f11f6f1764b222db)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` |
| `[ExplicitPaddings](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a737b3cc66404da9e6005481ea4e794d3)(const gtl::ArraySlice< int > & x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` |
| `[UseCudnnOnGpu](#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1a953aaf76215ad6a39ef6ca399022357c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Conv2DBackpropFilter::Attrs](../../../struct/tensorflow/ops/conv2-d-backprop-filter/attrs) | Optional attribute setters for [Conv2DBackpropFilter](conv2-d-backprop-filter#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conv2DBackpropFilter
```
Conv2DBackpropFilter(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter_sizes,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### Conv2DBackpropFilter
```
Conv2DBackpropFilter(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input filter_sizes,
::tensorflow::Input out_backprop,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const Conv2DBackpropFilter::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Dilations
```
Attrs Dilations(
const gtl::ArraySlice< int > & x
)
```
### ExplicitPaddings
```
Attrs ExplicitPaddings(
const gtl::ArraySlice< int > & x
)
```
### UseCudnnOnGpu
```
Attrs UseCudnnOnGpu(
bool x
)
```
tensorflow_cpp tensorflow::ops::ConjugateTranspose tensorflow::ops::ConjugateTranspose
===================================
`#include <array_ops.h>`
Shuffle dimensions of x according to a permutation and conjugate the result.
Summary
-------
The output `y` has the same rank as `x`. The shapes of `x` and `y` satisfy: `y.shape[i] == x.shape[perm[i]] for i in [0, 1, ..., rank(x) - 1]``y[i,j,k,...,s,t,u] == conj(x[perm[i], perm[j], perm[k],...,perm[s], perm[t], perm[u]])`
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[ConjugateTranspose](#classtensorflow_1_1ops_1_1_conjugate_transpose_1a4a5368d3cec175ad261612c95e8da6d3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) perm)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conjugate_transpose_1aa4e3004e201a961572c3999a46990f0b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_conjugate_transpose_1a804efbc2f1fec9fee64ccac9402bbbdd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conjugate_transpose_1a3829d54bcdcdc65f244e364383c52a12)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conjugate_transpose_1af0205b3679ff8def147607935343b1c1)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conjugate_transpose_1aec6563c894874b88ae5b51e91f251ef5)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### ConjugateTranspose
```
ConjugateTranspose(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input perm
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SegmentProd tensorflow::ops::SegmentProd
============================
`#include <math_ops.h>`
Computes the product along segments of a tensor.
Summary
-------
Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments.
Computes a tensor such that \(output\_i = \prod\_j data\_j\) where the product is over `j` such that `segment_ids[j] == i`.
If the product is empty for a given segment ID `i`, `output[i] = 1`.
Caution: On CPU, values in `segment_ids` are always validated to be sorted, and an error is thrown for indices that are not increasing. On GPU, this does not throw an error for unsorted indices. On GPU, out-of-order indices result in safe but unspecified behavior, which may include treating out-of-order indices as the same as a smaller following index.

For example:
c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.math.segment\_prod(c, tf.constant([0, 0, 1])).numpy() array([[4, 6, 6, 4], [5, 6, 7, 8]], dtype=int32)
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* segment\_ids: A 1-D tensor whose size is equal to the size of `data`'s first dimension. Values should be sorted and can be repeated.
Caution: The values are always validated to be sorted on CPU, never validated on GPU.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments.
| Constructors and Destructors |
| --- |
| `[SegmentProd](#classtensorflow_1_1ops_1_1_segment_prod_1aaa29c6154e234e016b12cd1090b92f35)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_segment_prod_1ac84b0698197c2bbb4314eb5bae40449a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_segment_prod_1ac9d3d5a23b913c1498c08f602603c920)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_segment_prod_1a1f6e38cb73fb96fc9c1033cce4caa6de)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_segment_prod_1a01f74b88504cb0e9f9e5c2da63373640)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_segment_prod_1a0d47f6ebf4f51b71f39d114d128c7194)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SegmentProd
```
SegmentProd(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input segment_ids
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Equal tensorflow::ops::Equal
======================
`#include <math_ops.h>`
Returns the truth value of (x == y) element-wise.
Summary
-------
*NOTE*: `[Equal](equal#classtensorflow_1_1ops_1_1_equal)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
```
x = tf.constant([2, 4])
y = tf.constant(2)
tf.math.equal(x, y) ==> array([True, False])
```
```
x = tf.constant([2, 4])
y = tf.constant([2, 4])
tf.math.equal(x, y) ==> array([True, True])
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Equal](#classtensorflow_1_1ops_1_1_equal_1a71df1d727899d9748a710214e9643ae4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| `[Equal](#classtensorflow_1_1ops_1_1_equal_1a6de2f17f741ab89eee7bb268fa5a00cb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, const [Equal::Attrs](../../../struct/tensorflow/ops/equal/attrs#structtensorflow_1_1ops_1_1_equal_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_equal_1a47c6893382f9747ebc851ee095e680df)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_equal_1af7bbce811e57c82c34bd390f377fbbf5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_equal_1a815a2eaa20ab636416bdc6c81c504d01)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_equal_1a54b4b003cfdb637811b2b384ae9333eb)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_equal_1a92922d4aec5aedb26c6abfcff968a304)() const` | |
| Public static functions |
| --- |
| `[IncompatibleShapeError](#classtensorflow_1_1ops_1_1_equal_1aff7de7b3ec11004e350cfa8bedfcde9d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/equal/attrs#structtensorflow_1_1ops_1_1_equal_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Equal::Attrs](../../../struct/tensorflow/ops/equal/attrs) | Optional attribute setters for [Equal](equal#classtensorflow_1_1ops_1_1_equal). |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Equal
```
Equal(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### Equal
```
Equal(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
const Equal::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### IncompatibleShapeError
```
Attrs IncompatibleShapeError(
bool x
)
```
tensorflow_cpp tensorflow::ops::BatchMatMulV3 tensorflow::ops::BatchMatMulV3
==============================
`#include <math_ops.h>`
Multiplies slices of two tensors in batches.
Summary
-------
Multiplies all slices of `[Tensor](../tensor#classtensorflow_1_1_tensor)``x` and `y` (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the `adj_x` or `adj_y` flag to `True`, which are by default `False`.
The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` and `[..., r_y, c_y]`.
The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where:
```
r_o = c_x if adj_x else r_x
c_o = r_y if adj_y else c_y
```
It is computed as:
```
output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
```
*NOTE*: `[BatchMatMulV3](batch-mat-mul-v3#classtensorflow_1_1ops_1_1_batch_mat_mul_v3)` supports broadcasting in the batch dimensions. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: 2-D or higher with shape `[..., r_x, c_x]`.
* y: 2-D or higher with shape `[..., r_y, c_y]`.
* Tout: If not spcified, Tout is the same type to input type.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v3/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs)`):
* adj\_x: If `True`, adjoint the slices of `x`. Defaults to `False`.
* adj\_y: If `True`, adjoint the slices of `y`. Defaults to `False`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 3-D or higher with shape `[..., r_o, c_o]`
| Constructors and Destructors |
| --- |
| `[BatchMatMulV3](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1a49499b3b5aafbb5a241b2ff33b4972cc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, DataType Tout)` |
| `[BatchMatMulV3](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1abbce65054facd4f2df8d88919f5e0cbf)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, DataType Tout, const [BatchMatMulV3::Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v3/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1af1c9e2fd37288bef39d7bcd2ec58f0f6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1a82f8662bc55036682ee2c44233e375d0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1a1d31166bd5c7e17dcf0ecde30ba4718d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1adf982bd1c0de71c88ed80f6702890115)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1a30fe5139657cc765041c604060d5f678)() const` | |
| Public static functions |
| --- |
| `[AdjX](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1a6e09ce476eba83069ee8ec0f50a0ef29)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v3/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs)` |
| `[AdjY](#classtensorflow_1_1ops_1_1_batch_mat_mul_v3_1a866cd9912df165ad1c49b557f516e8eb)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v3/attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BatchMatMulV3::Attrs](../../../struct/tensorflow/ops/batch-mat-mul-v3/attrs) | Optional attribute setters for [BatchMatMulV3](batch-mat-mul-v3#classtensorflow_1_1ops_1_1_batch_mat_mul_v3). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BatchMatMulV3
```
BatchMatMulV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
DataType Tout
)
```
### BatchMatMulV3
```
BatchMatMulV3(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
DataType Tout,
const BatchMatMulV3::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### AdjX
```
Attrs AdjX(
bool x
)
```
### AdjY
```
Attrs AdjY(
bool x
)
```
tensorflow_cpp tensorflow::ops::ParseSequenceExample tensorflow::ops::ParseSequenceExample
=====================================
`#include <parsing_ops.h>`
Transforms a vector of brain.SequenceExample protos (as strings) into typed tensors.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A vector containing binary serialized SequenceExample protos.
* debug\_name: A vector containing the names of the serialized protos. May contain, for example, table key (descriptive) name for the corresponding serialized proto. This is purely useful for debugging purposes, and the presence of values here has no effect on the output. May also be an empty vector if no name is available.
* context\_dense\_defaults: A list of Ncontext\_dense Tensors (some may be empty). context\_dense\_defaults[j] provides default values when the SequenceExample's context map lacks context\_dense\_key[j]. If an empty [Tensor](../tensor#classtensorflow_1_1_tensor) is provided for context\_dense\_defaults[j], then the Feature context\_dense\_keys[j] is required. The input type is inferred from context\_dense\_defaults[j], even when it's empty. If context\_dense\_defaults[j] is not empty, its shape must match context\_dense\_shapes[j].
* feature\_list\_dense\_missing\_assumed\_empty: A vector listing the FeatureList keys which may be missing from the SequenceExamples. If the associated FeatureList is missing, it is treated as empty. By default, any FeatureList not listed in this vector must exist in the SequenceExamples.
* context\_sparse\_keys: A list of Ncontext\_sparse string Tensors (scalars). The keys expected in the Examples' features associated with context\_sparse values.
* context\_dense\_keys: A list of Ncontext\_dense string Tensors (scalars). The keys expected in the SequenceExamples' context features associated with dense values.
* feature\_list\_sparse\_keys: A list of Nfeature\_list\_sparse string Tensors (scalars). The keys expected in the FeatureLists associated with sparse values.
* feature\_list\_dense\_keys: A list of Nfeature\_list\_dense string Tensors (scalars). The keys expected in the SequenceExamples' feature\_lists associated with lists of dense values.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)`):
* context\_sparse\_types: A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. Currently the [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* context\_dense\_shapes: A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. The number of elements in the Feature corresponding to context\_dense\_key[j] must always equal context\_dense\_shapes[j].NumEntries(). The shape of context\_dense\_values[j] will match context\_dense\_shapes[j].
* feature\_list\_sparse\_types: A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. Currently the [ParseSingleSequenceExample](parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* feature\_list\_dense\_shapes: A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. The shape of each Feature in the FeatureList corresponding to feature\_list\_dense\_key[j] must always equal feature\_list\_dense\_shapes[j].NumEntries().
Returns:
* `OutputList` context\_sparse\_indices
* `OutputList` context\_sparse\_values
* `OutputList` context\_sparse\_shapes
* `OutputList` context\_dense\_values
* `OutputList` feature\_list\_sparse\_indices
* `OutputList` feature\_list\_sparse\_values
* `OutputList` feature\_list\_sparse\_shapes
* `OutputList` feature\_list\_dense\_values
* `OutputList` feature\_list\_dense\_lengths
| Constructors and Destructors |
| --- |
| `[ParseSequenceExample](#classtensorflow_1_1ops_1_1_parse_sequence_example_1ad12ca6eb31a83db580165dda4912674b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) debug_name, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_defaults, const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_missing_assumed_empty, const gtl::ArraySlice<::tensorflow::tstring > & context_sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & context_dense_keys, const gtl::ArraySlice<::tensorflow::tstring > & feature_list_sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_keys)` |
| `[ParseSequenceExample](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a0389881ed9c0d7cb0791444bc973ee30)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::Input](../input#classtensorflow_1_1_input) debug_name, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) context_dense_defaults, const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_missing_assumed_empty, const gtl::ArraySlice<::tensorflow::tstring > & context_sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & context_dense_keys, const gtl::ArraySlice<::tensorflow::tstring > & feature_list_sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_keys, const [ParseSequenceExample::Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[context\_dense\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a0af6123fa9fbdc95e0b5a7de2e6b0bbb)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_indices](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a71a30646c669754f9905119da48e8320)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a9049c964a1785775559556fb021e6416)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[context\_sparse\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a08fece57b10752996ebc0acc6bcd4e18)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_dense\_lengths](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a4b024e7f1b4e67986f14c1f36eb9df12)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_dense\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a6817f62272e24f27c76da794078e6ffb)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_indices](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a7d385ae594813d143bb4aca04b23c88b)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a3a05c64abbcfbaef37fdf08ef65a5258)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[feature\_list\_sparse\_values](#classtensorflow_1_1ops_1_1_parse_sequence_example_1afc2b8f497dc3901ee8de8bfa5e17adc0)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_parse_sequence_example_1ad8a2ed886ed82472d224bd766b4df868)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[ContextDenseShapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a10bf1bf283d2f5275224a0265f767760)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[ContextSparseTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a586ecb54f4006e2528c9fe14052d94d4)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[FeatureListDenseShapes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1ae005f36c01bcf9c16da4a2f4c4cff0c0)(const gtl::ArraySlice< PartialTensorShape > & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[FeatureListDenseTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1ac2e81ff7ef5d15819b9ef566dfafeba4)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[FeatureListSparseTypes](#classtensorflow_1_1ops_1_1_parse_sequence_example_1ae97c9d413d1c2cb43c56787de6eca31e)(const DataTypeSlice & x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[NcontextDense](#classtensorflow_1_1ops_1_1_parse_sequence_example_1ac59b24777fb0fe09f2c4b5c5438ace2f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[NcontextSparse](#classtensorflow_1_1ops_1_1_parse_sequence_example_1a1397b974fe179a84e6e660eefce7fdcd)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[NfeatureListDense](#classtensorflow_1_1ops_1_1_parse_sequence_example_1aeb8664c54334bbdc392b6de9b78c0ed7)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| `[NfeatureListSparse](#classtensorflow_1_1ops_1_1_parse_sequence_example_1afd6d16b8c0740baa2a311d15df1a38c8)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ParseSequenceExample::Attrs](../../../struct/tensorflow/ops/parse-sequence-example/attrs) | Optional attribute setters for [ParseSequenceExample](parse-sequence-example#classtensorflow_1_1ops_1_1_parse_sequence_example). |
Public attributes
-----------------
### context\_dense\_values
```
::tensorflow::OutputList context_dense_values
```
### context\_sparse\_indices
```
::tensorflow::OutputList context_sparse_indices
```
### context\_sparse\_shapes
```
::tensorflow::OutputList context_sparse_shapes
```
### context\_sparse\_values
```
::tensorflow::OutputList context_sparse_values
```
### feature\_list\_dense\_lengths
```
::tensorflow::OutputList feature_list_dense_lengths
```
### feature\_list\_dense\_values
```
::tensorflow::OutputList feature_list_dense_values
```
### feature\_list\_sparse\_indices
```
::tensorflow::OutputList feature_list_sparse_indices
```
### feature\_list\_sparse\_shapes
```
::tensorflow::OutputList feature_list_sparse_shapes
```
### feature\_list\_sparse\_values
```
::tensorflow::OutputList feature_list_sparse_values
```
### operation
```
Operation operation
```
Public functions
----------------
### ParseSequenceExample
```
ParseSequenceExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input debug_name,
::tensorflow::InputList context_dense_defaults,
const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_missing_assumed_empty,
const gtl::ArraySlice<::tensorflow::tstring > & context_sparse_keys,
const gtl::ArraySlice<::tensorflow::tstring > & context_dense_keys,
const gtl::ArraySlice<::tensorflow::tstring > & feature_list_sparse_keys,
const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_keys
)
```
### ParseSequenceExample
```
ParseSequenceExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::Input debug_name,
::tensorflow::InputList context_dense_defaults,
const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_missing_assumed_empty,
const gtl::ArraySlice<::tensorflow::tstring > & context_sparse_keys,
const gtl::ArraySlice<::tensorflow::tstring > & context_dense_keys,
const gtl::ArraySlice<::tensorflow::tstring > & feature_list_sparse_keys,
const gtl::ArraySlice<::tensorflow::tstring > & feature_list_dense_keys,
const ParseSequenceExample::Attrs & attrs
)
```
Public static functions
-----------------------
### ContextDenseShapes
```
Attrs ContextDenseShapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### ContextSparseTypes
```
Attrs ContextSparseTypes(
const DataTypeSlice & x
)
```
### FeatureListDenseShapes
```
Attrs FeatureListDenseShapes(
const gtl::ArraySlice< PartialTensorShape > & x
)
```
### FeatureListDenseTypes
```
Attrs FeatureListDenseTypes(
const DataTypeSlice & x
)
```
### FeatureListSparseTypes
```
Attrs FeatureListSparseTypes(
const DataTypeSlice & x
)
```
### NcontextDense
```
Attrs NcontextDense(
int64 x
)
```
### NcontextSparse
```
Attrs NcontextSparse(
int64 x
)
```
### NfeatureListDense
```
Attrs NfeatureListDense(
int64 x
)
```
### NfeatureListSparse
```
Attrs NfeatureListSparse(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Restore tensorflow::ops::Restore
========================
`#include <io_ops.h>`
Restores a tensor from checkpoint files.
Summary
-------
Reads a tensor stored in one or several files. If there are several files (for instance because a tensor was saved as slices), `file_pattern` may contain wildcard symbols (`*` and `?`) in the filename portion only, not in the directory portion.
If a `file_pattern` matches several files, `preferred_shard` can be used to hint in which file the requested tensor is likely to be found. This op will first open the file at index `preferred_shard` in the list of matching files and try to restore tensors from that file. Only if some tensors or tensor slices are not found in that first file, then the Op opens all the files. Setting `preferred_shard` to match the value passed as the `shard` input of a matching `[Save](save#classtensorflow_1_1ops_1_1_save)` Op may speed up [Restore](restore#classtensorflow_1_1ops_1_1_restore). This attribute only affects performance, not correctness. The default value -1 means files are processed in order.
See also `[RestoreSlice](restore-slice#classtensorflow_1_1ops_1_1_restore_slice)`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* file\_pattern: Must have a single element. The pattern of the files from which we read the tensor.
* tensor\_name: Must have a single element. The name of the tensor to be restored.
* dt: The type of the tensor to be restored.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/restore/attrs#structtensorflow_1_1ops_1_1_restore_1_1_attrs)`):
* preferred\_shard: Index of file to open first if multiple files match `file_pattern`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The restored tensor.
| Constructors and Destructors |
| --- |
| `[Restore](#classtensorflow_1_1ops_1_1_restore_1a06392cfeb62e5bbcd5a12c8c24f4a454)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) file_pattern, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_name, DataType dt)` |
| `[Restore](#classtensorflow_1_1ops_1_1_restore_1a6bc04bd5b6925c42d2ab9fac0d053774)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) file_pattern, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_name, DataType dt, const [Restore::Attrs](../../../struct/tensorflow/ops/restore/attrs#structtensorflow_1_1ops_1_1_restore_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_restore_1a512f0dcb5d23dea3939e1086b78490c9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[tensor](#classtensorflow_1_1ops_1_1_restore_1a7d6ad76f209f846683849ffcf4e5b2f9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_restore_1a6b5a77883f915a4b7e800cbda2f6b18a)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_restore_1a20bb2f66a51a1413dda2b18f7880983f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_restore_1ab93346099735ce634a6caa5d98b8785d)() const` | |
| Public static functions |
| --- |
| `[PreferredShard](#classtensorflow_1_1ops_1_1_restore_1afca86c5066310bcef8e07db991a9df2f)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/restore/attrs#structtensorflow_1_1ops_1_1_restore_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Restore::Attrs](../../../struct/tensorflow/ops/restore/attrs) | Optional attribute setters for [Restore](restore#classtensorflow_1_1ops_1_1_restore). |
Public attributes
-----------------
### operation
```
Operation operation
```
### tensor
```
::tensorflow::Output tensor
```
Public functions
----------------
### Restore
```
Restore(
const ::tensorflow::Scope & scope,
::tensorflow::Input file_pattern,
::tensorflow::Input tensor_name,
DataType dt
)
```
### Restore
```
Restore(
const ::tensorflow::Scope & scope,
::tensorflow::Input file_pattern,
::tensorflow::Input tensor_name,
DataType dt,
const Restore::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### PreferredShard
```
Attrs PreferredShard(
int64 x
)
```
tensorflow_cpp tensorflow::ops::ReaderReadUpTo tensorflow::ops::ReaderReadUpTo
===============================
`#include <io_ops.h>`
Returns up to `num_records` (key, value) pairs produced by a Reader.
Summary
-------
Will dequeue from the input queue if necessary (e.g. when the Reader needs to start reading from a new file since it has finished with the previous file). It may return less than `num_records` even before the last batch.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a `Reader`.
* queue\_handle: Handle to a `Queue`, with string work items.
* num\_records: number of records to read from `Reader`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` keys: A 1-D tensor.
* `[Output](../output#classtensorflow_1_1_output)` values: A 1-D tensor.
| Constructors and Destructors |
| --- |
| `[ReaderReadUpTo](#classtensorflow_1_1ops_1_1_reader_read_up_to_1a2ec15832620e45ab0ea0a17f650cb1f5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) queue_handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_records)` |
| Public attributes |
| --- |
| `[keys](#classtensorflow_1_1ops_1_1_reader_read_up_to_1af7a8295467508f82a27607fc8f67ed71)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_reader_read_up_to_1a5b7389ad7ab4f4d1dc2c976d3dd52e9e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_reader_read_up_to_1abb8bf94a488824b08dc38f935f62a0be)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### keys
```
::tensorflow::Output keys
```
### operation
```
Operation operation
```
### values
```
::tensorflow::Output values
```
Public functions
----------------
### ReaderReadUpTo
```
ReaderReadUpTo(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle,
::tensorflow::Input queue_handle,
::tensorflow::Input num_records
)
```
tensorflow_cpp tensorflow::ops::QuantizedConcat tensorflow::ops::QuantizedConcat
================================
`#include <array_ops.h>`
Concatenates quantized tensors along one dimension.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* concat\_dim: 0-D. The dimension along which to concatenate. Must be in the range [0, rank(values)).
* values: The `N` Tensors to concatenate. Their ranks and types must match, and their sizes must match in all dimensions except `concat_dim`.
* input\_mins: The minimum scalar values for each of the input tensors.
* input\_maxes: The maximum scalar values for each of the input tensors.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the concatenation of values stacked along the `concat_dim` dimension. This tensor's shape matches that of `values` except in `concat_dim` where it has the sum of the sizes.
* `[Output](../output#classtensorflow_1_1_output)` output\_min: The float value that the minimum quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` output\_max: The float value that the maximum quantized output value represents.
| Constructors and Destructors |
| --- |
| `[QuantizedConcat](#classtensorflow_1_1ops_1_1_quantized_concat_1a6ebd37038b8fed1e45c560d7e7fcbc2b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) concat_dim, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) input_mins, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) input_maxes)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_concat_1af047989041a8b8eba230e0651d46c9e8)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantized_concat_1a7b1bfd305adec2548519a7de10e9381f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_max](#classtensorflow_1_1ops_1_1_quantized_concat_1a34abcaca945d5e8b09df9e778b96983f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_min](#classtensorflow_1_1ops_1_1_quantized_concat_1ac7e70b4452898593c806e108bc1daff0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
### output\_max
```
::tensorflow::Output output_max
```
### output\_min
```
::tensorflow::Output output_min
```
Public functions
----------------
### QuantizedConcat
```
QuantizedConcat(
const ::tensorflow::Scope & scope,
::tensorflow::Input concat_dim,
::tensorflow::InputList values,
::tensorflow::InputList input_mins,
::tensorflow::InputList input_maxes
)
```
tensorflow_cpp tensorflow::ops::QuantizedInstanceNorm tensorflow::ops::QuantizedInstanceNorm
======================================
`#include <array_ops.h>`
Quantized Instance normalization.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: A 4D input [Tensor](../tensor#classtensorflow_1_1_tensor).
* x\_min: The value represented by the lowest quantized input.
* x\_max: The value represented by the highest quantized input.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)`):
* output\_range\_given: If True, `given_y_min` and `given_y_min` and `given_y_max` are used as the output range. Otherwise, the implementation computes the output range.
* given\_y\_min: [Output](../output#classtensorflow_1_1_output) in `y_min` if `output_range_given` is True.
* given\_y\_max: [Output](../output#classtensorflow_1_1_output) in `y_max` if `output_range_given` is True.
* variance\_epsilon: A small float number to avoid dividing by 0.
* min\_separation: [Minimum](minimum#classtensorflow_1_1ops_1_1_minimum) value of `y_max - y_min`
Returns:
* `[Output](../output#classtensorflow_1_1_output)` y: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor).
* `[Output](../output#classtensorflow_1_1_output)` y\_min: The value represented by the lowest quantized output.
* `[Output](../output#classtensorflow_1_1_output)` y\_max: The value represented by the highest quantized output.
| Constructors and Destructors |
| --- |
| `[QuantizedInstanceNorm](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a66f14d43d5a9459d866db037f7bb4906)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x_max)` |
| `[QuantizedInstanceNorm](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1ac70831b63384f7e34a878a00fccc1b5e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x_max, const [QuantizedInstanceNorm::Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a9c16e83b751d6d10a6bca12d0abb615f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1ad70ba4eba105fb7eae8362df8a2cfccd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[y\_max](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a9ecfdc7d60f12b5439992b5e0e9d70bf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[y\_min](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a4e52b8d2fb01146563d0679d4b72dcb7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[GivenYMax](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1ab8f1ad838d1814616fbd34a0c34cfc00)(float x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` |
| `[GivenYMin](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a59f4f357b2be2e533c5e60801d978170)(float x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` |
| `[MinSeparation](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a971e6b0a27bdc399ed7e5d9837dcbe39)(float x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` |
| `[OutputRangeGiven](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1a8b157c23eb87cca9013c02ae6cadb1a6)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` |
| `[VarianceEpsilon](#classtensorflow_1_1ops_1_1_quantized_instance_norm_1ad19d246905b047dfa2a65bd7bb7fd601)(float x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedInstanceNorm::Attrs](../../../struct/tensorflow/ops/quantized-instance-norm/attrs) | Optional attribute setters for [QuantizedInstanceNorm](quantized-instance-norm#classtensorflow_1_1ops_1_1_quantized_instance_norm). |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
### y\_max
```
::tensorflow::Output y_max
```
### y\_min
```
::tensorflow::Output y_min
```
Public functions
----------------
### QuantizedInstanceNorm
```
QuantizedInstanceNorm(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input x_min,
::tensorflow::Input x_max
)
```
### QuantizedInstanceNorm
```
QuantizedInstanceNorm(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input x_min,
::tensorflow::Input x_max,
const QuantizedInstanceNorm::Attrs & attrs
)
```
Public static functions
-----------------------
### GivenYMax
```
Attrs GivenYMax(
float x
)
```
### GivenYMin
```
Attrs GivenYMin(
float x
)
```
### MinSeparation
```
Attrs MinSeparation(
float x
)
```
### OutputRangeGiven
```
Attrs OutputRangeGiven(
bool x
)
```
### VarianceEpsilon
```
Attrs VarianceEpsilon(
float x
)
```
tensorflow_cpp tensorflow::ops::ReaderRestoreState tensorflow::ops::ReaderRestoreState
===================================
`#include <io_ops.h>`
[Restore](restore#classtensorflow_1_1ops_1_1_restore) a reader to a previously saved state.
Summary
-------
Not all Readers support being restored, so this can produce an Unimplemented error.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* reader\_handle: Handle to a Reader.
* state: Result of a [ReaderSerializeState](reader-serialize-state#classtensorflow_1_1ops_1_1_reader_serialize_state) of a Reader with type matching reader\_handle.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ReaderRestoreState](#classtensorflow_1_1ops_1_1_reader_restore_state_1a89d3806e028e0917362aa36fd51ce849)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reader_handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) state)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_reader_restore_state_1a03de5f453506a3a89e1318a3def9a647)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_reader_restore_state_1a169bff5be553fea3119e14d118cd9475)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ReaderRestoreState
```
ReaderRestoreState(
const ::tensorflow::Scope & scope,
::tensorflow::Input reader_handle,
::tensorflow::Input state
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::ResourceSparseApplyAdagradDA tensorflow::ops::ResourceSparseApplyAdagradDA
=============================================
`#include <training_ops.h>`
Update entries in '\*var' and '\*accum' according to the proximal adagrad scheme.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* gradient\_accumulator: Should be from a Variable().
* gradient\_squared\_accumulator: Should be from a Variable().
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
* lr: Learning rate. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* global\_step: Training step number. Must be a scalar.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceSparseApplyAdagradDA](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1a73ffdbfa10ec272bfe2b93f579109c28)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step)` |
| `[ResourceSparseApplyAdagradDA](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1aae8dd33efc6b892fa94673149d533534)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradient_squared_accumulator, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) global_step, const [ResourceSparseApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1af19182343e1d08847c2cf51d1ae38840)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1a2d06e93c04e37fbab24141d187d63698)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1aef5e4815d60b62a5862a6a8427f5d3ae)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad-d-a/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceSparseApplyAdagradDA::Attrs](../../../struct/tensorflow/ops/resource-sparse-apply-adagrad-d-a/attrs) | Optional attribute setters for [ResourceSparseApplyAdagradDA](resource-sparse-apply-adagrad-d-a#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceSparseApplyAdagradDA
```
ResourceSparseApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step
)
```
### ResourceSparseApplyAdagradDA
```
ResourceSparseApplyAdagradDA(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input gradient_accumulator,
::tensorflow::Input gradient_squared_accumulator,
::tensorflow::Input grad,
::tensorflow::Input indices,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input global_step,
const ResourceSparseApplyAdagradDA::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Square tensorflow::ops::Square
=======================
`#include <math_ops.h>`
Computes square of x element-wise.
Summary
-------
I.e., \(y = x \* x = x^2\).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Square](#classtensorflow_1_1ops_1_1_square_1a49f6b72a7130c4dfacd00c06444c46ce)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_square_1a33057649fb5f4e65ac0ab3e883b216b6)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_square_1ae48bc99b974c8e297140b7d4693e7d9a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_square_1aaf0852a213d5e708577180c2388107db)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_square_1a9d67ed042071d54b96e47850c85d4506)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_square_1a5e4ded12905fda7d7acf07db7134e995)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Square
```
Square(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::CombinedNonMaxSuppression tensorflow::ops::CombinedNonMaxSuppression
==========================================
`#include <image_ops.h>`
Greedily selects a subset of bounding boxes in descending order of score,.
Summary
-------
This operation performs non\_max\_suppression on the inputs per batch, across all classes. Prunes away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system. Also note that this algorithm is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is the final boxes, scores and classes tensor returned after performing non\_max\_suppression.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* boxes: A 4-D float tensor of shape `[batch_size, num_boxes, q, 4]`. If `q` is 1 then same boxes are used for all classes otherwise, if `q` is equal to number of classes, class-specific boxes are used.
* scores: A 3-D float tensor of shape `[batch_size, num_boxes, num_classes]` representing a single score corresponding to each box (each row of boxes).
* max\_output\_size\_per\_class: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression per class
* max\_total\_size: An int32 scalar representing the maximum number of boxes retained over all classes. Note that setting this value to a large number may result in OOM error depending on the system workload.
* iou\_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
* score\_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs)`):
* pad\_per\_class: If false, the output nmsed boxes, scores and classes are padded/clipped to `max_total_size`. If true, the output nmsed boxes, scores and classes are padded to be of length `max_size_per_class`\*`num_classes`, unless it exceeds `max_total_size` in which case it is clipped to `max_total_size`. Defaults to false.
* clip\_boxes: If true, assume the box coordinates are between [0, 1] and clip the output boxes if they fall beyond [0, 1]. If false, do not do clipping and output the box coordinates as it is.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` nmsed\_boxes: A [batch\_size, max\_detections, 4] float32 tensor containing the non-max suppressed boxes.
* `[Output](../output#classtensorflow_1_1_output)` nmsed\_scores: A [batch\_size, max\_detections] float32 tensor containing the scores for the boxes.
* `[Output](../output#classtensorflow_1_1_output)` nmsed\_classes: A [batch\_size, max\_detections] float32 tensor containing the classes for the boxes.
* `[Output](../output#classtensorflow_1_1_output)` valid\_detections: A [batch\_size] int32 tensor indicating the number of valid detections per batch item. Only the top num\_detections[i] entries in nms\_boxes[i], nms\_scores[i] and nms\_class[i] are valid. The rest of the entries are zero paddings.
| Constructors and Destructors |
| --- |
| `[CombinedNonMaxSuppression](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a37433d4e2aa6d72fde6172813056fd7e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size_per_class, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_total_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold)` |
| `[CombinedNonMaxSuppression](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a2ad706eeb5912c87ebbbd6db116d303b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size_per_class, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_total_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold, ::[tensorflow::Input](../input#classtensorflow_1_1_input) score_threshold, const [CombinedNonMaxSuppression::Attrs](../../../struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[nmsed\_boxes](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a26fe07d747c139edcecac96e27a26d8a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[nmsed\_classes](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a2684d63b2b480538fd1b801cd32d09ae)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[nmsed\_scores](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a979fef315b03030a750668758a75211b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a77c909be6771b9070654cdb791ad3667)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[valid\_detections](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a01b23f77d5db080eac0d7c43d6be83d7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[ClipBoxes](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a27f4c9e9f78ab3448359cee869b2db76)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs)` |
| `[PadPerClass](#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a9f704224f56d8d5a9459e3e5e6ff5e56)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::CombinedNonMaxSuppression::Attrs](../../../struct/tensorflow/ops/combined-non-max-suppression/attrs) | Optional attribute setters for [CombinedNonMaxSuppression](combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression). |
Public attributes
-----------------
### nmsed\_boxes
```
::tensorflow::Output nmsed_boxes
```
### nmsed\_classes
```
::tensorflow::Output nmsed_classes
```
### nmsed\_scores
```
::tensorflow::Output nmsed_scores
```
### operation
```
Operation operation
```
### valid\_detections
```
::tensorflow::Output valid_detections
```
Public functions
----------------
### CombinedNonMaxSuppression
```
CombinedNonMaxSuppression(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size_per_class,
::tensorflow::Input max_total_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold
)
```
### CombinedNonMaxSuppression
```
CombinedNonMaxSuppression(
const ::tensorflow::Scope & scope,
::tensorflow::Input boxes,
::tensorflow::Input scores,
::tensorflow::Input max_output_size_per_class,
::tensorflow::Input max_total_size,
::tensorflow::Input iou_threshold,
::tensorflow::Input score_threshold,
const CombinedNonMaxSuppression::Attrs & attrs
)
```
Public static functions
-----------------------
### ClipBoxes
```
Attrs ClipBoxes(
bool x
)
```
### PadPerClass
```
Attrs PadPerClass(
bool x
)
```
tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV4 tensorflow::ops::QuantizeAndDequantizeV4
========================================
`#include <array_ops.h>`
Quantizes then dequantizes a tensor.
Summary
-------
This is almost identical to [QuantizeAndDequantizeV2](quantize-and-dequantize-v2#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2), except that it returns a gradient of 1 for inputs that are within the quantization range, or 0 otherwise.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: [Tensor](../tensor#classtensorflow_1_1_tensor) to quantize and then dequantize.
* input\_min: If `range_given == True`, this specifies the minimum input value that needs to be represented, otherwise it is determined from the min value of the `input` tensor.
* input\_max: If `range_given == True`, this specifies the maximum input value that needs to be represented, otherwise it is determined from the max value of the `input` tensor.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)`):
* signed\_input: Whether the quantization is signed or unsigned. (actually this parameter should have been called **`signed_output`** )
* num\_bits: The bitwidth of the quantization.
* range\_given: Whether the range is given or should be determined from the `input` tensor.
* round\_mode: The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. The following rounding modes are currently supported:
* HALF\_TO\_EVEN: this is the default round\_mode.
* HALF\_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 rounds up to -7.
* narrow\_range: If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. i.e. for 8 bit quantization, the minimum value is -127 instead of -128.
* axis: If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[QuantizeAndDequantizeV4](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1adf55b9a7b0c3fa2453f41c8dbf1a5efe)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max)` |
| `[QuantizeAndDequantizeV4](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1ad468066168d14743d1848d5071f8ae62)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, const [QuantizeAndDequantizeV4::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1acc1392aae55ad8bb0568d36a666ae25c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a7262a1066f9e9739306a7ab4708f7565)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1af8b0df43395454f3df89a8c20a4c3d60)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1ac4a46ea522efb956a6b595c85d366c13)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a181936ef24e93066a7e9f65bcf9a4aa3)() const` | |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a42f19fcdd47c2b3c4131f3bf517c7607)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a7948a2a783c7126aadc0a919fb2cb415)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` |
| `[NumBits](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a028ca64d10adcee074d4a035d04a87be)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` |
| `[RangeGiven](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a7309d808ec9f47ae828e02f088915d14)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` |
| `[RoundMode](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1a7017bf1bd8c367a9db4e516c8593a94c)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` |
| `[SignedInput](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1aa3c14ff4d3c6f20bcb9cf7b33fa28286)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizeAndDequantizeV4::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4/attrs) | Optional attribute setters for [QuantizeAndDequantizeV4](quantize-and-dequantize-v4#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### QuantizeAndDequantizeV4
```
QuantizeAndDequantizeV4(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max
)
```
### QuantizeAndDequantizeV4
```
QuantizeAndDequantizeV4(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max,
const QuantizeAndDequantizeV4::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### NumBits
```
Attrs NumBits(
int64 x
)
```
### RangeGiven
```
Attrs RangeGiven(
bool x
)
```
### RoundMode
```
Attrs RoundMode(
StringPiece x
)
```
### SignedInput
```
Attrs SignedInput(
bool x
)
```
tensorflow_cpp tensorflow::ops::RandomUniform tensorflow::ops::RandomUniform
==============================
`#include <random_ops.h>`
Outputs random values from a uniform distribution.
Summary
-------
The generated values follow a uniform distribution in the range `[0, 1)`. The lower bound 0 is included in the range, while the upper bound 1 is excluded.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: The shape of the output tensor.
* dtype: The type of the output.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/random-uniform/attrs#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs)`):
* seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.
* seed2: A second seed to avoid seed collision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A tensor of the specified shape filled with uniform random values.
| Constructors and Destructors |
| --- |
| `[RandomUniform](#classtensorflow_1_1ops_1_1_random_uniform_1ad758763396f811e3da060a04692f3757)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype)` |
| `[RandomUniform](#classtensorflow_1_1ops_1_1_random_uniform_1af801ace5d9f1abc9d79f7faa85b91be1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype, const [RandomUniform::Attrs](../../../struct/tensorflow/ops/random-uniform/attrs#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_random_uniform_1a48b146cd2bbea78fcf781a469864ef5b)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_random_uniform_1a54d90aa9b91d5e835309793ec96a7c8c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_random_uniform_1ad3b4ee570c67616fea7d0670af60cc64)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_uniform_1ab00525e4be653b53523769acea109196)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_uniform_1ac3f462ba3c34c4b0d7c759eb376e778c)() const` | |
| Public static functions |
| --- |
| `[Seed](#classtensorflow_1_1ops_1_1_random_uniform_1a73a0bbeaa8d9935acb48c58b8b636644)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-uniform/attrs#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs)` |
| `[Seed2](#classtensorflow_1_1ops_1_1_random_uniform_1a4821471eea8691d99ec491eef1aedd06)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/random-uniform/attrs#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RandomUniform::Attrs](../../../struct/tensorflow/ops/random-uniform/attrs) | Optional attribute setters for [RandomUniform](random-uniform#classtensorflow_1_1ops_1_1_random_uniform). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RandomUniform
```
RandomUniform(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype
)
```
### RandomUniform
```
RandomUniform(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype,
const RandomUniform::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Seed
```
Attrs Seed(
int64 x
)
```
### Seed2
```
Attrs Seed2(
int64 x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SparseCrossV2 tensorflow::ops::SparseCrossV2
==============================
`#include <sparse_ops.h>`
Generates sparse cross from a list of sparse and dense tensors.
Summary
-------
The op takes two lists, one of 2D `SparseTensor` and one of 2D `[Tensor](../tensor#classtensorflow_1_1_tensor)`, each representing features of one feature column. It outputs a 2D `SparseTensor` with the batchwise crosses of these features.
For example, if the inputs are
```
inputs[0]: SparseTensor with shape = [2, 2]
[0, 0]: "a"
[1, 0]: "b"
[1, 1]: "c"
inputs[1]: SparseTensor with shape = [2, 1]
[0, 0]: "d"
[1, 0]: "e"
inputs[2]: Tensor [["f"], ["g"]]
```
then the output will be
```
shape = [2, 2]
[0, 0]: "a_X_d_X_f"
[1, 0]: "b_X_e_X_g"
[1, 1]: "c_X_e_X_g"
```
if hashed\_output=true then the output will be
```
shape = [2, 2]
[0, 0]: FingerprintCat64(
Fingerprint64("f"), FingerprintCat64(
Fingerprint64("d"), Fingerprint64("a")))
[1, 0]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("b")))
[1, 1]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("c")))
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* indices: 2-D. Indices of each input `SparseTensor`.
* values: 1-D. values of each `SparseTensor`.
* shapes: 1-D. Shapes of each `SparseTensor`.
* dense\_inputs: 2-D. Columns represented by dense `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* sep: string used when joining a list of string inputs, can be used as separator later.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. Indices of the concatenated `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. Non-empty values of the concatenated or hashed `SparseTensor`.
* `[Output](../output#classtensorflow_1_1_output)` output\_shape: 1-D. Shape of the concatenated `SparseTensor`.
| Constructors and Destructors |
| --- |
| `[SparseCrossV2](#classtensorflow_1_1ops_1_1_sparse_cross_v2_1ae89e0641a930cc74c70db91ae255b8f9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) shapes, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sep)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_cross_v2_1a46e35e55d0f69d5eeede3a2c7de87fb1)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_cross_v2_1ae471585b6a0df390797be5f207d43f95)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_cross_v2_1a831b3fdb33f4042e2c933e337c80f606)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_values](#classtensorflow_1_1ops_1_1_sparse_cross_v2_1af2c843f4a0bd62be2eacad8dd6c929d5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_indices
```
::tensorflow::Output output_indices
```
### output\_shape
```
::tensorflow::Output output_shape
```
### output\_values
```
::tensorflow::Output output_values
```
Public functions
----------------
### SparseCrossV2
```
SparseCrossV2(
const ::tensorflow::Scope & scope,
::tensorflow::InputList indices,
::tensorflow::InputList values,
::tensorflow::InputList shapes,
::tensorflow::InputList dense_inputs,
::tensorflow::Input sep
)
```
tensorflow_cpp tensorflow::ops::SoftmaxCrossEntropyWithLogits tensorflow::ops::SoftmaxCrossEntropyWithLogits
==============================================
`#include <nn_ops.h>`
Computes softmax cross entropy cost and gradients to backpropagate.
Summary
-------
Inputs are the logits, not probabilities.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* features: batch\_size x num\_classes matrix
* labels: batch\_size x num\_classes matrix The caller must ensure that each batch of labels represents a valid probability distribution.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` loss: Per example loss (batch\_size vector).
* `[Output](../output#classtensorflow_1_1_output)` backprop: backpropagated gradients (batch\_size x num\_classes matrix).
| Constructors and Destructors |
| --- |
| `[SoftmaxCrossEntropyWithLogits](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1a4cbff4fa9d4606e374b1a88b5de132dc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features, ::[tensorflow::Input](../input#classtensorflow_1_1_input) labels)` |
| Public attributes |
| --- |
| `[backprop](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1a3f3e88d3a28b38d7190c586e53a90391)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[loss](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1ad3f6fea2fc731063932763fa4b3c8ce0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_softmax_cross_entropy_with_logits_1aec7fdf4d82369e8bc00d0c9c8dd7faab)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### backprop
```
::tensorflow::Output backprop
```
### loss
```
::tensorflow::Output loss
```
### operation
```
Operation operation
```
Public functions
----------------
### SoftmaxCrossEntropyWithLogits
```
SoftmaxCrossEntropyWithLogits(
const ::tensorflow::Scope & scope,
::tensorflow::Input features,
::tensorflow::Input labels
)
```
tensorflow_cpp tensorflow::ops::ParseSingleExample tensorflow::ops::ParseSingleExample
===================================
`#include <parsing_ops.h>`
Transforms a tf.Example proto (as a string) into typed tensors.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* serialized: A vector containing a batch of binary serialized Example protos.
* dense\_defaults: A list of Tensors (some may be empty), whose length matches the length of `dense_keys`. dense\_defaults[j] provides default values when the example's feature\_map lacks dense\_key[j]. If an empty [Tensor](../tensor#classtensorflow_1_1_tensor) is provided for dense\_defaults[j], then the Feature dense\_keys[j] is required. The input type is inferred from dense\_defaults[j], even when it's empty. If dense\_defaults[j] is not empty, and dense\_shapes[j] is fully defined, then the shape of dense\_defaults[j] must match that of dense\_shapes[j]. If dense\_shapes[j] has an undefined major dimension (variable strides dense feature), dense\_defaults[j] must contain a single element: the padding element.
* num\_sparse: The number of sparse features to be parsed from the example. This must match the lengths of `sparse_keys` and `sparse_types`.
* sparse\_keys: A list of `num_sparse` strings. The keys expected in the Examples' features associated with sparse values.
* dense\_keys: The keys expected in the Examples' features associated with dense values.
* sparse\_types: A list of `num_sparse` types; the data types of data in each Feature given in sparse\_keys. Currently the [ParseSingleExample](parse-single-example#classtensorflow_1_1ops_1_1_parse_single_example) op supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList).
* dense\_shapes: The shapes of data in each Feature given in dense\_keys. The length of this list must match the length of `dense_keys`. The number of elements in the Feature corresponding to dense\_key[j] must always equal dense\_shapes[j].NumEntries(). If dense\_shapes[j] == (D0, D1, ..., DN) then the shape of output [Tensor](../tensor#classtensorflow_1_1_tensor) dense\_values[j] will be (D0, D1, ..., DN): In the case dense\_shapes[j] = (-1, D1, ..., DN), the shape of the output [Tensor](../tensor#classtensorflow_1_1_tensor) dense\_values[j] will be (M, D1, .., DN), where M is the number of blocks of elements of length D1 \* .... \* DN, in the input.
Returns:
* `OutputList` sparse\_indices
* `OutputList` sparse\_values
* `OutputList` sparse\_shapes
* `OutputList` dense\_values
| Constructors and Destructors |
| --- |
| `[ParseSingleExample](#classtensorflow_1_1ops_1_1_parse_single_example_1a2907d81d498acfa5ffbe97b70859a6ac)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) dense_defaults, int64 num_sparse, const gtl::ArraySlice<::tensorflow::tstring > & sparse_keys, const gtl::ArraySlice<::tensorflow::tstring > & dense_keys, const DataTypeSlice & sparse_types, const gtl::ArraySlice< PartialTensorShape > & dense_shapes)` |
| Public attributes |
| --- |
| `[dense\_values](#classtensorflow_1_1ops_1_1_parse_single_example_1a47aea5050a1c195f45e106a7e5dd8d6c)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[operation](#classtensorflow_1_1ops_1_1_parse_single_example_1a653e666e79f4a510ce99022030457306)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[sparse\_indices](#classtensorflow_1_1ops_1_1_parse_single_example_1aff26528d71218f864c4bbe158da75497)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_shapes](#classtensorflow_1_1ops_1_1_parse_single_example_1a43c18746bd9c93c475b6f796e90cf197)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| `[sparse\_values](#classtensorflow_1_1ops_1_1_parse_single_example_1a0dbd7fd1ac19943db8a06f1004a43731)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
Public attributes
-----------------
### dense\_values
```
::tensorflow::OutputList dense_values
```
### operation
```
Operation operation
```
### sparse\_indices
```
::tensorflow::OutputList sparse_indices
```
### sparse\_shapes
```
::tensorflow::OutputList sparse_shapes
```
### sparse\_values
```
::tensorflow::OutputList sparse_values
```
Public functions
----------------
### ParseSingleExample
```
ParseSingleExample(
const ::tensorflow::Scope & scope,
::tensorflow::Input serialized,
::tensorflow::InputList dense_defaults,
int64 num_sparse,
const gtl::ArraySlice<::tensorflow::tstring > & sparse_keys,
const gtl::ArraySlice<::tensorflow::tstring > & dense_keys,
const DataTypeSlice & sparse_types,
const gtl::ArraySlice< PartialTensorShape > & dense_shapes
)
```
tensorflow_cpp tensorflow::ops::OrderedMapStage tensorflow::ops::OrderedMapStage
================================
`#include <data_flow_ops.h>`
[Stage](stage#classtensorflow_1_1ops_1_1_stage) (key, values) in the underlying container which behaves like a ordered.
Summary
-------
associative container. Elements are ordered by key.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* key: int64
* values: a list of tensors dtypes A list of data types that inserted values should adhere to.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)`):
* capacity: [Maximum](maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached.
* container: If non-empty, this queue is placed in the given container. Otherwise, a default container is used.
* shared\_name: It is necessary to match this name to the matching [Unstage](unstage#classtensorflow_1_1ops_1_1_unstage) Op.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[OrderedMapStage](#classtensorflow_1_1ops_1_1_ordered_map_stage_1adf188c3597b625e81bcb70ff56667db7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, const DataTypeSlice & dtypes)` |
| `[OrderedMapStage](#classtensorflow_1_1ops_1_1_ordered_map_stage_1aaa1699a9f09c104ca0a64ba8362bcd67)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, const DataTypeSlice & dtypes, const [OrderedMapStage::Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ordered_map_stage_1a879532a804924ee18c8f93b5696dab60)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_ordered_map_stage_1ac0d1962e39443ff063cafdb7e02b19de)() const` | |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_stage_1afb3caabf3337c15b43fde879648be5cb)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_ordered_map_stage_1ae78db609e6d2caa71d25b0dedd45fa0e)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_stage_1a335dd884f3d2149b623b69ede1b8b172)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_stage_1a1fa852bca494c90e1a83a3a7f05a9af8)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::OrderedMapStage::Attrs](../../../struct/tensorflow/ops/ordered-map-stage/attrs) | Optional attribute setters for [OrderedMapStage](ordered-map-stage#classtensorflow_1_1ops_1_1_ordered_map_stage). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### OrderedMapStage
```
OrderedMapStage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
::tensorflow::InputList values,
const DataTypeSlice & dtypes
)
```
### OrderedMapStage
```
OrderedMapStage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
::tensorflow::InputList values,
const DataTypeSlice & dtypes,
const OrderedMapStage::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Empty tensorflow::ops::Empty
======================
`#include <array_ops.h>`
Creates a tensor with the given shape.
Summary
-------
This operation creates a tensor of `shape` and `dtype`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* shape: 1-D. Represents the shape of the output tensor.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/empty/attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs)`):
* init: If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A `[Tensor](../tensor#classtensorflow_1_1_tensor)` of type `T`.
| Constructors and Destructors |
| --- |
| `[Empty](#classtensorflow_1_1ops_1_1_empty_1afbeeb90876baaa5131ccd9ae1a733689)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype)` |
| `[Empty](#classtensorflow_1_1ops_1_1_empty_1a17ea31d51cede367a541675480d77a3f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shape, DataType dtype, const [Empty::Attrs](../../../struct/tensorflow/ops/empty/attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_empty_1ae377e8630513546e65d719d56ecfe136)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_empty_1a9c7d05401a0aa67f82fe592682f0bc15)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_empty_1a4fdbda6ce5b2f476acc70ada9df3eaa2)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_empty_1ac54e9b4ae90bf596166c770dc6d22ce5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_empty_1a9ae3f6fbe95cde1fcec65896b5397511)() const` | |
| Public static functions |
| --- |
| `[Init](#classtensorflow_1_1ops_1_1_empty_1ac0b3b4819671ba0dd14c7ca6c1bacae4)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/empty/attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Empty::Attrs](../../../struct/tensorflow/ops/empty/attrs) | Optional attribute setters for [Empty](empty#classtensorflow_1_1ops_1_1_empty). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Empty
```
Empty(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype
)
```
### Empty
```
Empty(
const ::tensorflow::Scope & scope,
::tensorflow::Input shape,
DataType dtype,
const Empty::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Init
```
Attrs Init(
bool x
)
```
tensorflow_cpp tensorflow::ops::TensorArrayClose tensorflow::ops::TensorArrayClose
=================================
`#include <data_flow_ops.h>`
Delete the [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) from its resource container.
Summary
-------
This enables the user to close and release the resource in the middle of a step/run.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) (output of [TensorArray](tensor-array#classtensorflow_1_1ops_1_1_tensor_array) or [TensorArrayGrad](tensor-array-grad#classtensorflow_1_1ops_1_1_tensor_array_grad)).
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[TensorArrayClose](#classtensorflow_1_1ops_1_1_tensor_array_close_1ab5ed3b657f40eaa4996badf026bfd639)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tensor_array_close_1a6f7610da9f8ff494f5d7cf3c8056953e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_tensor_array_close_1a20f4809d157b1a557f5cd925131fedf2)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### TensorArrayClose
```
TensorArrayClose(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Atanh tensorflow::ops::Atanh
======================
`#include <math_ops.h>`
Computes inverse hyperbolic tangent of x element-wise.
Summary
-------
Given an input tensor, this function computes inverse hyperbolic tangent for every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `[-1,1]` and output range is `[-inf, inf]`. If input is `-1`, output will be `-inf` and if the input is `1`, output will be `inf`. Values outside the range will have `nan` as output.
```
x = tf.constant([-float("inf"), -1, -0.5, 1, 0, 0.5, 10, float("inf")])
tf.math.atanh(x) ==> [nan -inf -0.54930615 inf 0. 0.54930615 nan nan]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Atanh](#classtensorflow_1_1ops_1_1_atanh_1a373f165458a8748baeda2376b2a07099)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_atanh_1adda95e4091dbd4b8abf840f6f82f07ad)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_atanh_1ab10eb0eccc1c32c93dc106a8a477db23)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_atanh_1ab2d6f0ee19ee69ee4a8f11c430937264)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_atanh_1a38bd91e6a66c5d315d7fbace30b54739)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_atanh_1a3db7c9040bbdd8e75150ee18f9883645)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Atanh
```
Atanh(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Complex tensorflow::ops::Complex
========================
`#include <math_ops.h>`
Converts two real numbers to a complex number.
Summary
-------
Given a tensor `real` representing the real part of a complex number, and a tensor `imag` representing the imaginary part of a complex number, this operation returns complex numbers elementwise of the form \(a + bj\), where *a* represents the `real` part and *b* represents the `imag` part.
The input tensors `real` and `imag` must have the same shape.
For example:
```
# tensor 'real' is [2.25, 3.25]
# tensor `imag` is [4.75, 5.75]
tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The out tensor.
| Constructors and Destructors |
| --- |
| `[Complex](#classtensorflow_1_1ops_1_1_complex_1a1a408c4b23b2713522e40da08c6fd1ca)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) real, ::[tensorflow::Input](../input#classtensorflow_1_1_input) imag)` |
| `[Complex](#classtensorflow_1_1ops_1_1_complex_1a6ce8570ce7740f8f1b49b2af15f49cb2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) real, ::[tensorflow::Input](../input#classtensorflow_1_1_input) imag, const [Complex::Attrs](../../../struct/tensorflow/ops/complex/attrs#structtensorflow_1_1ops_1_1_complex_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_complex_1aeba6f262bfca7f97cf33679ca976b5a3)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_complex_1a7a21ca24321bcd95ea7d7084420665b7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_complex_1a4f74d182d8d81302845eb3368d92fa66)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_complex_1a71e48dcf7a59ef40afc258356df18810)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_complex_1a968614d690b87e4089d84b5d66e47d69)() const` | |
| Public static functions |
| --- |
| `[Tout](#classtensorflow_1_1ops_1_1_complex_1a4569ccb9e7ceedcb6fbdd624aca041fa)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/complex/attrs#structtensorflow_1_1ops_1_1_complex_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Complex::Attrs](../../../struct/tensorflow/ops/complex/attrs) | Optional attribute setters for [Complex](complex#classtensorflow_1_1ops_1_1_complex). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### Complex
```
Complex(
const ::tensorflow::Scope & scope,
::tensorflow::Input real,
::tensorflow::Input imag
)
```
### Complex
```
Complex(
const ::tensorflow::Scope & scope,
::tensorflow::Input real,
::tensorflow::Input imag,
const Complex::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Tout
```
Attrs Tout(
DataType x
)
```
tensorflow_cpp tensorflow::ops::LessEqual tensorflow::ops::LessEqual
==========================
`#include <math_ops.h>`
Returns the truth value of (x <= y) element-wise.
Summary
-------
*NOTE*: `[LessEqual](less-equal#classtensorflow_1_1ops_1_1_less_equal)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
Example:
```
x = tf.constant([5, 4, 6])
y = tf.constant([5])
tf.math.less_equal(x, y) ==> [True, True, False]
```
```
x = tf.constant([5, 4, 6])
y = tf.constant([5, 6, 6])
tf.math.less_equal(x, y) ==> [True, True, True]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[LessEqual](#classtensorflow_1_1ops_1_1_less_equal_1a2a5f11e8fa1262f354ef90ad9c2c5353)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_less_equal_1ab41ca9c4ae2399ea33480596d0f5e25c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_less_equal_1a54fbf9704c7bfa6527f17750f661c889)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_less_equal_1ae4dc635b73c8dd346ec57cdee37213d9)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_less_equal_1af7ed473089edffb3da17c9879bcff62f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_less_equal_1afb05f0ece23a4ec7b78f810ec47c94e9)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### LessEqual
```
LessEqual(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseApplyAdagrad tensorflow::ops::SparseApplyAdagrad
===================================
`#include <training_ops.h>`
Update relevant entries in '\*var' and '\*accum' according to the adagrad scheme.
Summary
-------
That is for rows we have grad for, we update var and accum as follows: $$accum += grad \* grad$$ $$var -= lr \* grad \* (1 / sqrt(accum))$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs)`):
* use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyAdagrad](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1a8654c81ae7fb822d3d68cf07933298c5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[SparseApplyAdagrad](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1a065426b919fd035ddb0cff7f0d0383b2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [SparseApplyAdagrad::Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1a583fccf8242cbba9ca0966f1f164f279)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1acfcb53bfa0178d5f4531764444a70568)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1a82b4ae6551f4a0d9456891da05823903)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1a1bd37515accb4c3505c3432dbcaaff2d)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1ab850cf3221b4383f0d773d8211173ac7)() const` | |
| Public static functions |
| --- |
| `[UpdateSlots](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1afa53af54d646c0cd056c3e5d9ae19970)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs)` |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_1ab561ae2919f29d971d0c0b28448f1695)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyAdagrad::Attrs](../../../struct/tensorflow/ops/sparse-apply-adagrad/attrs) | Optional attribute setters for [SparseApplyAdagrad](sparse-apply-adagrad#classtensorflow_1_1ops_1_1_sparse_apply_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyAdagrad
```
SparseApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### SparseApplyAdagrad
```
SparseApplyAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input grad,
::tensorflow::Input indices,
const SparseApplyAdagrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UpdateSlots
```
Attrs UpdateSlots(
bool x
)
```
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::InTopKV2 tensorflow::ops::InTopKV2
=========================
`#include <nn_ops.h>`
Says whether the targets are in the top `K` predictions.
Summary
-------
This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the prediction for the target class is among the top `k` predictions among all predictions for example `i`. Note that the behavior of `[InTopK](in-top-k#classtensorflow_1_1ops_1_1_in_top_k)` differs from the `[TopK](top-k#classtensorflow_1_1ops_1_1_top_k)` op in its handling of ties; if multiple classes have the same prediction value and straddle the top-`k` boundary, all of those classes are considered to be in the top `k`.
More formally, let
\(predictions\_i\) be the predictions for all classes for example `i`, \(targets\_i\) be the target class for example `i`, \(out\_i\) be the output for example `i`,
$$out\_i = predictions\_{i, targets\_i} \in TopKIncludingTies(predictions\_i)$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* predictions: A `batch_size` x `classes` tensor.
* targets: A `batch_size` vector of class ids.
* k: Number of top elements to look at for computing precision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Computed precision at `k` as a `bool [Tensor](../tensor#classtensorflow_1_1_tensor)`.
| Constructors and Destructors |
| --- |
| `[InTopKV2](#classtensorflow_1_1ops_1_1_in_top_k_v2_1a7c731af26675d2a0a5e65d4bf0501a07)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) predictions, ::[tensorflow::Input](../input#classtensorflow_1_1_input) targets, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_in_top_k_v2_1ad9127d0ee0e56405da77c8f8f0b0ad34)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[precision](#classtensorflow_1_1ops_1_1_in_top_k_v2_1a66a3668a94dcfe6ed4412c6d48fac92b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_in_top_k_v2_1aca4c7a082803ec5e95dfcafac0999657)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_in_top_k_v2_1a7197986e89c2315b1a6458dcffdfd0d5)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_in_top_k_v2_1aa8a166a0b803daf34df7fd9ef3c91d40)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### precision
```
::tensorflow::Output precision
```
Public functions
----------------
### InTopKV2
```
InTopKV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input predictions,
::tensorflow::Input targets,
::tensorflow::Input k
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizeV2 tensorflow::ops::QuantizeV2
===========================
`#include <array_ops.h>`
Quantize the 'input' tensor of type float to 'output' tensor of type 'T'.
Summary
-------
[min\_range, max\_range] are scalar floats that specify the range for the 'input' data. The 'mode' attribute controls exactly which calculations are used to convert the float values to their quantized equivalents. The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents.
In 'MIN\_COMBINED' mode, each value of the tensor will undergo the following:
```
out[i] = (in[i] - min_range) * range(T) / (max_range - min_range)
if T == qint8: out[i] -= (range(T) + 1) / 2.0
```
here `range(T) = numeric_limits::max() - numeric\_limits::min()`
*MIN\_COMBINED Mode Example*
Assume the input is type float and has a possible range of [0.0, 6.0] and the output type is quint8 ([0, 255]). The min\_range and max\_range values should be specified as 0.0 and 6.0. Quantizing from float to quint8 will multiply each value of the input by 255/6 and cast to quint8.
If the output type was qint8 ([-128, 127]), the operation will additionally subtract each value by 128 prior to casting, so that the range of values aligns with the range of qint8.
If the mode is 'MIN\_FIRST', then this approach is used:
```
num_discrete_values = 1 << (# of bits in T)
range_adjust = num_discrete_values / (num_discrete_values - 1)
range = (range_max - range_min) * range_adjust
range_scale = num_discrete_values / range
quantized = round(input * range_scale) - round(range_min * range_scale) +
numeric_limits::min()
quantized = max(quantized, numeric_limits::min())
quantized = min(quantized, numeric_limits::max())
```
The biggest difference between this and MIN\_COMBINED is that the minimum range is rounded first, before it's subtracted from the rounded value. With MIN\_COMBINED, a small bias is introduced where repeated iterations of quantizing and dequantizing will introduce a larger and larger error.
*SCALED mode Example*
`SCALED` mode matches the quantization approach used in `QuantizeAndDequantize{V2|V3}`.
If the mode is `SCALED`, the quantization is performed by multiplying each input value by a scaling\_factor. The scaling\_factor is determined from `min_range` and `max_range` to be as large as possible such that the range from `min_range` to `max_range` is representable within values of type T.
```
const int min_T = std::numeric_limits::min();
const int max_T = std::numeric_limits::max();
const float max_float = std::numeric_limits::max();
```
```
const float scale_factor_from_min_side =
(min_T * min_range > 0) ? min_T / min_range : max_float;
const float scale_factor_from_max_side =
(max_T * max_range > 0) ? max_T / max_range : max_float;
```
```
const float scale_factor = std::min(scale_factor_from_min_side,
scale_factor_from_max_side);
```
We next use the scale\_factor to adjust min\_range and max\_range as follows:
```
min_range = min_T / scale_factor;
max_range = max_T / scale_factor;
```
e.g. if T = qint8, and initially min\_range = -10, and max\_range = 9, we would compare -128/-10.0 = 12.8 to 127/9.0 = 14.11, and set scaling\_factor = 12.8 In this case, min\_range would remain -10, but max\_range would be adjusted to 127 / 12.8 = 9.921875
So we will quantize input values in the range (-10, 9.921875) to (-128, 127).
The input tensor can now be quantized by clipping values to the range `min_range` to `max_range`, then multiplying by scale\_factor as follows:
```
result = round(min(max_range, max(min_range, input)) * scale_factor)
```
The adjusted `min_range` and `max_range` are returned as outputs 2 and 3 of this operation. These outputs should be used as the range for any further calculations.
*narrow\_range (bool) attribute*
If true, we do not use the minimum quantized value. i.e. for int8 the quantized output, it would be restricted to the range -127..127 instead of the full -128..127 range. This is provided for compatibility with certain inference backends. (Only applies to SCALED mode)
*axis (int) attribute*
An optional `axis` attribute can specify a dimension index of the input tensor, such that quantization ranges will be calculated and applied separately for each slice of the tensor along that dimension. This is useful for per-channel quantization.
If axis is specified, min\_range and max\_range
if `axis`=None, per-tensor quantization is performed as normal.
*ensure\_minimum\_range (float) attribute*
Ensures the minimum quantization range is at least this value. The legacy default value for this is 0.01, but it is strongly suggested to set it to 0 for new uses.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_range: The minimum value of the quantization range. This value may be adjusted by the op depending on other parameters. The adjusted value is written to `output_min`. If the `axis` attribute is specified, this must be a 1-D tensor whose size matches the `axis` dimension of the input and output tensors.
* max\_range: The maximum value of the quantization range. This value may be adjusted by the op depending on other parameters. The adjusted value is written to `output_max`. If the `axis` attribute is specified, this must be a 1-D tensor whose size matches the `axis` dimension of the input and output tensors.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output: The quantized data produced from the float input.
* `[Output](../output#classtensorflow_1_1_output)` output\_min: The final quantization range minimum, used to clip input values before scaling and rounding them to quantized values. If the `axis` attribute is specified, this will be a 1-D tensor whose size matches the `axis` dimension of the input and output tensors.
* `[Output](../output#classtensorflow_1_1_output)` output\_max: The final quantization range maximum, used to clip input values before scaling and rounding them to quantized values. If the `axis` attribute is specified, this will be a 1-D tensor whose size matches the `axis` dimension of the input and output tensors.
| Constructors and Destructors |
| --- |
| `[QuantizeV2](#classtensorflow_1_1ops_1_1_quantize_v2_1aac3aa6f1389108bdf11da28fbe9aef92)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_range, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_range, DataType T)` |
| `[QuantizeV2](#classtensorflow_1_1ops_1_1_quantize_v2_1a7881efba11474e644c63d7540730053d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_range, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_range, DataType T, const [QuantizeV2::Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantize_v2_1ad0de103146d140ed0b4bf277d2dd9af2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_quantize_v2_1ada6c67087a12267be45aac6a9120de55)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_max](#classtensorflow_1_1ops_1_1_quantize_v2_1a79cc3f023f74de524cd442b0492e4dae)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_min](#classtensorflow_1_1ops_1_1_quantize_v2_1a7690769886d844fc55484420e1c43b65)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_quantize_v2_1a9481394f84777c80c8637171d995c3a5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` |
| `[EnsureMinimumRange](#classtensorflow_1_1ops_1_1_quantize_v2_1aa998d3704b78d2ad9581d3f62805b0fd)(float x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` |
| `[Mode](#classtensorflow_1_1ops_1_1_quantize_v2_1aad3b22239c9881921a6553cef91d9e9a)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` |
| `[NarrowRange](#classtensorflow_1_1ops_1_1_quantize_v2_1a066e4d34982e2bdd2e51c81c078a45e2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` |
| `[RoundMode](#classtensorflow_1_1ops_1_1_quantize_v2_1af537bced0682ba25e43c0d5856fd38a5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizeV2::Attrs](../../../struct/tensorflow/ops/quantize-v2/attrs) | Optional attribute setters for [QuantizeV2](quantize-v2#classtensorflow_1_1ops_1_1_quantize_v2). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
### output\_max
```
::tensorflow::Output output_max
```
### output\_min
```
::tensorflow::Output output_min
```
Public functions
----------------
### QuantizeV2
```
QuantizeV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input min_range,
::tensorflow::Input max_range,
DataType T
)
```
### QuantizeV2
```
QuantizeV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input min_range,
::tensorflow::Input max_range,
DataType T,
const QuantizeV2::Attrs & attrs
)
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
### EnsureMinimumRange
```
Attrs EnsureMinimumRange(
float x
)
```
### Mode
```
Attrs Mode(
StringPiece x
)
```
### NarrowRange
```
Attrs NarrowRange(
bool x
)
```
### RoundMode
```
Attrs RoundMode(
StringPiece x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::RaggedBincount tensorflow::ops::RaggedBincount
===============================
`#include <math_ops.h>`
Counts the number of occurrences of each value in an integer array.
Summary
-------
Outputs a vector with length `size` and the same dtype as `weights`. If `weights` are empty, then index `i` stores the number of times the value `i` is counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of the value in `weights` at each index where the corresponding value in `arr` is `i`.
Values in `arr` outside of the range [0, size) are ignored.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* splits: 1D int64 `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* values: 2D int `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* size: non-negative int scalar `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* weights: is an int32, int64, float32, or float64 `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as `input`, or a length-0 `[Tensor](../tensor#classtensorflow_1_1_tensor)`, in which case it acts as all weights equal to 1.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)`):
* binary\_output: bool; Whether the kernel should count the appearance or number of occurrences.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with length equal to `size` or 2D `[Tensor](../tensor#classtensorflow_1_1_tensor)` with [batch\_size, `size`]. The counts or summed weights for each value in the range [0, size).
| Constructors and Destructors |
| --- |
| `[RaggedBincount](#classtensorflow_1_1ops_1_1_ragged_bincount_1af6554de96f809fccbd678adaffbc3c24)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) splits, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights)` |
| `[RaggedBincount](#classtensorflow_1_1ops_1_1_ragged_bincount_1ab10c029cf1e632fc88ce35a983cecd43)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) splits, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) weights, const [RaggedBincount::Attrs](../../../struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ragged_bincount_1a733325350aabe10af880482ad5e1f9e0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_ragged_bincount_1a29aa4960a91cfce90a6ff9b5bdd8f47d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ragged_bincount_1ab80b688c6e079f3cb485c27bae9fc4f6)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ragged_bincount_1a3ee830fe3366afe1d6d8185e5d362999)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ragged_bincount_1a0258579a8e475e40192adf1f9d54b806)() const` | |
| Public static functions |
| --- |
| `[BinaryOutput](#classtensorflow_1_1ops_1_1_ragged_bincount_1a9853523da24b28968c4a53efae303ab9)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::RaggedBincount::Attrs](../../../struct/tensorflow/ops/ragged-bincount/attrs) | Optional attribute setters for [RaggedBincount](ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RaggedBincount
```
RaggedBincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input splits,
::tensorflow::Input values,
::tensorflow::Input size,
::tensorflow::Input weights
)
```
### RaggedBincount
```
RaggedBincount(
const ::tensorflow::Scope & scope,
::tensorflow::Input splits,
::tensorflow::Input values,
::tensorflow::Input size,
::tensorflow::Input weights,
const RaggedBincount::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### BinaryOutput
```
Attrs BinaryOutput(
bool x
)
```
tensorflow_cpp tensorflow::ops::StringFormat tensorflow::ops::StringFormat
=============================
`#include <string_ops.h>`
Formats a string template using a list of tensors.
Summary
-------
Formats a string template using a list of tensors, pretty-printing tensor summaries.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* inputs: The list of tensors to format into the placeholder string.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-format/attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)`):
* template\_: A string, the template to format tensor summaries into.
* placeholder: A string, at each placeholder in the template a subsequent tensor summary will be inserted.
* summarize: When formatting the tensor summaries print the first and last summarize entries of each tensor dimension.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = The resulting string scalar.
| Constructors and Destructors |
| --- |
| `[StringFormat](#classtensorflow_1_1ops_1_1_string_format_1a2a49e6e78ef8bc53f1c131f57472c80f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs)` |
| `[StringFormat](#classtensorflow_1_1ops_1_1_string_format_1aa206a8f6062c185cd4054ea9c3eae135)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs, const [StringFormat::Attrs](../../../struct/tensorflow/ops/string-format/attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_string_format_1a79b84b00b14555109e9d022ed1d18247)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_string_format_1ad804e61daa8ee29a7589034620bc6957)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_string_format_1a17f33c98eb82880a699b4fd280414866)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_format_1a18c365d68dd132b199860fd218352055)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_format_1a09f95b504d354326ed3bf116fefce058)() const` | |
| Public static functions |
| --- |
| `[Placeholder](#classtensorflow_1_1ops_1_1_string_format_1a5bbe893329638ba81c31a259ff88b059)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/string-format/attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)` |
| `[Summarize](#classtensorflow_1_1ops_1_1_string_format_1af1d26efd4527e1af585402a951364b86)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/string-format/attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)` |
| `[Template](#classtensorflow_1_1ops_1_1_string_format_1ac90801110cd85e5c9cdee2b025a7284b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/string-format/attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringFormat::Attrs](../../../struct/tensorflow/ops/string-format/attrs) | Optional attribute setters for [StringFormat](string-format#classtensorflow_1_1ops_1_1_string_format). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### StringFormat
```
StringFormat(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs
)
```
### StringFormat
```
StringFormat(
const ::tensorflow::Scope & scope,
::tensorflow::InputList inputs,
const StringFormat::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Placeholder
```
Attrs Placeholder(
StringPiece x
)
```
### Summarize
```
Attrs Summarize(
int64 x
)
```
### Template
```
Attrs Template(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::MapUnstage tensorflow::ops::MapUnstage
===========================
`#include <data_flow_ops.h>`
Op removes and returns the values associated with the key.
Summary
-------
from the underlying container. If the underlying container does not contain this key, the op will block until it does.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `OutputList`: The values tensor.
| Constructors and Destructors |
| --- |
| `[MapUnstage](#classtensorflow_1_1ops_1_1_map_unstage_1a507cfd6b94db6018cf4bc2ceb519e383)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes)` |
| `[MapUnstage](#classtensorflow_1_1ops_1_1_map_unstage_1a5ce4089b5a5b9bf85877425d13dc1b49)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) key, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const DataTypeSlice & dtypes, const [MapUnstage::Attrs](../../../struct/tensorflow/ops/map-unstage/attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_map_unstage_1a6850ac842d63a353d6642fe8e3aaae8c)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[values](#classtensorflow_1_1ops_1_1_map_unstage_1a5418fbabe0895fa460e28b2694c81d39)` | `::[tensorflow::OutputList](../../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` |
| Public functions |
| --- |
| `[operator[]](#classtensorflow_1_1ops_1_1_map_unstage_1a813608c15ad1f77c488bf244b5b798de)(size_t index) const` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Capacity](#classtensorflow_1_1ops_1_1_map_unstage_1aac6c05112bba8a0b99ef373f35b307b4)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage/attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` |
| `[Container](#classtensorflow_1_1ops_1_1_map_unstage_1af9a176503b7fbffef43f8b5e669ba873)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage/attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` |
| `[MemoryLimit](#classtensorflow_1_1ops_1_1_map_unstage_1a3adf8cce8d2e39b22b892719b267f762)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage/attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` |
| `[SharedName](#classtensorflow_1_1ops_1_1_map_unstage_1aa3c016e8cc900640155e2eb7a791e5ca)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/map-unstage/attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::MapUnstage::Attrs](../../../struct/tensorflow/ops/map-unstage/attrs) | Optional attribute setters for [MapUnstage](map-unstage#classtensorflow_1_1ops_1_1_map_unstage). |
Public attributes
-----------------
### operation
```
Operation operation
```
### values
```
::tensorflow::OutputList values
```
Public functions
----------------
### MapUnstage
```
MapUnstage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes
)
```
### MapUnstage
```
MapUnstage(
const ::tensorflow::Scope & scope,
::tensorflow::Input key,
::tensorflow::Input indices,
const DataTypeSlice & dtypes,
const MapUnstage::Attrs & attrs
)
```
### operator[]
```
::tensorflow::Output operator[](
size_t index
) const
```
Public static functions
-----------------------
### Capacity
```
Attrs Capacity(
int64 x
)
```
### Container
```
Attrs Container(
StringPiece x
)
```
### MemoryLimit
```
Attrs MemoryLimit(
int64 x
)
```
### SharedName
```
Attrs SharedName(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Fact tensorflow::ops::Fact
=====================
`#include <user_ops.h>`
[Output](../output#classtensorflow_1_1_output) a fact about factorials.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The fact tensor.
| Constructors and Destructors |
| --- |
| `[Fact](#classtensorflow_1_1ops_1_1_fact_1a7b52819e0294d51f340d83e82c374b52)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` |
| Public attributes |
| --- |
| `[fact](#classtensorflow_1_1ops_1_1_fact_1a95c336498111ca9d4e073438f0abf2e3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fact_1a3a50db0a1de49e083be18cf230278df2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_fact_1ae7192ed7efa4975b18b272d3dc3b8d1f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fact_1ae63805d4bf024519038322a48dbfe37c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fact_1a46fa8cc4721c0814cf9911685650d19b)() const` | |
Public attributes
-----------------
### fact
```
::tensorflow::Output fact
```
### operation
```
Operation operation
```
Public functions
----------------
### Fact
```
Fact(
const ::tensorflow::Scope & scope
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ResourceApplyAdamWithAmsgrad tensorflow::ops::ResourceApplyAdamWithAmsgrad
=============================================
`#include <training_ops.h>`
Update '\*var' according to the Adam algorithm.
Summary
-------
$$\text{lr}\_t := \mathrm{learning\_rate} \* \sqrt{1 - \beta\_2^t} / (1 - \beta\_1^t)$$ $$m\_t := \beta\_1 \* m\_{t-1} + (1 - \beta\_1) \* g$$ $$v\_t := \beta\_2 \* v\_{t-1} + (1 - \beta\_2) \* g \* g$$ $$\hat{v}\_t := max{\hat{v}\_{t-1}, v\_t}$$ $$\text{variable} := \text{variable} - \text{lr}\_t \* m\_t / (\sqrt{\hat{v}\_t} + \epsilon)$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* m: Should be from a Variable().
* v: Should be from a Variable().
* vhat: Should be from a Variable().
* beta1\_power: Must be a scalar.
* beta2\_power: Must be a scalar.
* lr: Scaling factor. Must be a scalar.
* beta1: Momentum factor. Must be a scalar.
* beta2: Momentum factor. Must be a scalar.
* epsilon: Ridge term. Must be a scalar.
* grad: The gradient.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-adam-with-amsgrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1_1_attrs)`):
* use\_locking: If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyAdamWithAmsgrad](#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1a76c2fd9a089e3d00f1c5efc4948dcfa8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) vhat, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` |
| `[ResourceApplyAdamWithAmsgrad](#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1a875458300576d2e270cddcffa71e079c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) vhat, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2_power, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyAdamWithAmsgrad::Attrs](../../../struct/tensorflow/ops/resource-apply-adam-with-amsgrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1a56a6e586ba373ea479c1ec80ebdbb5fa)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1a8171cbe4e65ce2472e54d8cf14349a6d)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1a86eb3692613e7db3ca54090c9f22c353)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-adam-with-amsgrad/attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyAdamWithAmsgrad::Attrs](../../../struct/tensorflow/ops/resource-apply-adam-with-amsgrad/attrs) | Optional attribute setters for [ResourceApplyAdamWithAmsgrad](resource-apply-adam-with-amsgrad#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyAdamWithAmsgrad
```
ResourceApplyAdamWithAmsgrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input v,
::tensorflow::Input vhat,
::tensorflow::Input beta1_power,
::tensorflow::Input beta2_power,
::tensorflow::Input lr,
::tensorflow::Input beta1,
::tensorflow::Input beta2,
::tensorflow::Input epsilon,
::tensorflow::Input grad
)
```
### ResourceApplyAdamWithAmsgrad
```
ResourceApplyAdamWithAmsgrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input m,
::tensorflow::Input v,
::tensorflow::Input vhat,
::tensorflow::Input beta1_power,
::tensorflow::Input beta2_power,
::tensorflow::Input lr,
::tensorflow::Input beta1,
::tensorflow::Input beta2,
::tensorflow::Input epsilon,
::tensorflow::Input grad,
const ResourceApplyAdamWithAmsgrad::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ScatterNdAdd tensorflow::ops::ScatterNdAdd
=============================
`#include <state_ops.h>`
Applies sparse addition to individual values or slices in a [Variable](variable#classtensorflow_1_1ops_1_1_variable).
Summary
-------
`ref` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with rank `P` and `indices` is a `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`. It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of `indices` (with length `K`) corresponds to indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th dimension of `ref`.
`updates` is `[Tensor](../tensor#classtensorflow_1_1_tensor)` of rank `Q-1+P-K` with shape:
```
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
```
For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 elements. In Python, that addition would look like this:
```
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
indices = tf.constant([[4], [3], [1], [7]])
updates = tf.constant([9, 10, 11, 12])
add = tf.scatter_nd_add(ref, indices, updates)
with tf.Session() as sess:
print sess.run(add)
```
The resulting update to ref would look like this:
```
[1, 13, 3, 14, 14, 6, 7, 20]
```
See `tf.scatter_nd` for more details about how to make updates to slices.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* ref: A mutable [Tensor](../tensor#classtensorflow_1_1_tensor). Should be from a [Variable](variable#classtensorflow_1_1ops_1_1_variable) node.
* indices: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must be one of the following types: int32, int64. A tensor of indices into ref.
* updates: A [Tensor](../tensor#classtensorflow_1_1_tensor). Must have the same type as ref. A tensor of updated values to add to ref.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-nd-add/attrs#structtensorflow_1_1ops_1_1_scatter_nd_add_1_1_attrs)`):
* use\_locking: An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as ref. Returned as a convenience for operations that want to use the updated values after the update is done.
| Constructors and Destructors |
| --- |
| `[ScatterNdAdd](#classtensorflow_1_1ops_1_1_scatter_nd_add_1a138d4ff980f1a1c856fa78bd86a09e54)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` |
| `[ScatterNdAdd](#classtensorflow_1_1ops_1_1_scatter_nd_add_1ae0ef19022b7465666026da0e92b88989)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterNdAdd::Attrs](../../../struct/tensorflow/ops/scatter-nd-add/attrs#structtensorflow_1_1ops_1_1_scatter_nd_add_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_scatter_nd_add_1a1c417c3ef3f4b9045718379caed4fa18)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_nd_add_1a87550a24f5b9120902042ec65b457c6a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_scatter_nd_add_1a2527951beff23f5d906fe8c451a4d3c6)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_nd_add_1a0f4d17afad4086d274e3a5f342cb6b41)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_nd_add_1af62e0d7ee1e7c513f1ca2b1e126c6361)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_nd_add_1a6e1404fae24acf1e8128e7f2963fb31c)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-nd-add/attrs#structtensorflow_1_1ops_1_1_scatter_nd_add_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ScatterNdAdd::Attrs](../../../struct/tensorflow/ops/scatter-nd-add/attrs) | Optional attribute setters for [ScatterNdAdd](scatter-nd-add#classtensorflow_1_1ops_1_1_scatter_nd_add). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_ref
```
::tensorflow::Output output_ref
```
Public functions
----------------
### ScatterNdAdd
```
ScatterNdAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates
)
```
### ScatterNdAdd
```
ScatterNdAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input ref,
::tensorflow::Input indices,
::tensorflow::Input updates,
const ScatterNdAdd::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::Sigmoid tensorflow::ops::Sigmoid
========================
`#include <math_ops.h>`
Computes sigmoid of `x` element-wise.
Summary
-------
Specifically, `y = 1 / (1 + exp(-x))`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Sigmoid](#classtensorflow_1_1ops_1_1_sigmoid_1aa3522be3da7dfce34f9452ac1e50f3ad)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sigmoid_1a7510133da66857644ca854ee1ed05d08)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_sigmoid_1ad94ceae4a7f1bf47d0285330a1024531)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sigmoid_1aa2ef05c0c8da4b7413334495c88e7e65)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sigmoid_1abce577eaf16b4adcd83dd2b2e727f9f2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sigmoid_1af68f44411b3bde4a020ce8a25efe7b7a)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Sigmoid
```
Sigmoid(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ClipByValue tensorflow::ops::ClipByValue
============================
`#include <math_ops.h>`
Clips tensor values to a specified min and max.
Summary
-------
Given a tensor `t`, this operation returns a tensor of the same type and shape as `t` with its values clipped to `clip_value_min` and `clip_value_max`. [Any](any#classtensorflow_1_1ops_1_1_any) values less than `clip_value_min` are set to `clip_value_min`. [Any](any#classtensorflow_1_1ops_1_1_any) values greater than `clip_value_max` are set to `clip_value_max`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* t: A `[Tensor](../tensor#classtensorflow_1_1_tensor)`.
* clip\_value\_min: A 0-D (scalar) `[Tensor](../tensor#classtensorflow_1_1_tensor)`, or a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as `t`. The minimum value to clip by.
* clip\_value\_max: A 0-D (scalar) `[Tensor](../tensor#classtensorflow_1_1_tensor)`, or a `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as `t`. The maximum value to clip by.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: A clipped `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same shape as input 't'.
| Constructors and Destructors |
| --- |
| `[ClipByValue](#classtensorflow_1_1ops_1_1_clip_by_value_1ab526bd89e515b8086815ed1ca60ee26b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) t, ::[tensorflow::Input](../input#classtensorflow_1_1_input) clip_value_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) clip_value_max)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_clip_by_value_1a6ea3cb903878a47217c33415704ba5d0)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_clip_by_value_1aaeb2e1fae647e0a8606ada4557524321)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_clip_by_value_1a53b0735ad42735c966c3a18bd0425150)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_clip_by_value_1afb378365ea16f406988ca25a97ef57b9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_clip_by_value_1a7cb582679c053b906ea8f0e1df01a18a)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### ClipByValue
```
ClipByValue(
const ::tensorflow::Scope & scope,
::tensorflow::Input t,
::tensorflow::Input clip_value_min,
::tensorflow::Input clip_value_max
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::DiagPart tensorflow::ops::DiagPart
=========================
`#include <array_ops.h>`
Returns the diagonal part of the tensor.
Summary
-------
This operation returns a tensor with the `diagonal` part of the `input`. The `diagonal` part is computed as follows:
Assume `input` has dimensions `[D1,..., Dk, D1,..., Dk]`, then the output is a tensor of rank `k` with dimensions `[D1,..., Dk]` where:
`diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]`.
For example:
```
# 'input' is [[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]]
```
```
tf.diag_part(input) ==> [1, 2, 3, 4]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank k tensor where k is even and not zero.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The extracted diagonal.
| Constructors and Destructors |
| --- |
| `[DiagPart](#classtensorflow_1_1ops_1_1_diag_part_1a722e0fbf9139d42128d88361fcceffbb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[diagonal](#classtensorflow_1_1ops_1_1_diag_part_1a5c2700969d74c5dcd441f482f69f0575)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_diag_part_1a4a4d8b4387110108a77726a4e37f75ef)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_diag_part_1a7f5dfaa792daf4eebe39b740aaa5a117)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_diag_part_1aef16d4b10102516c099741c0935952e9)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_diag_part_1a3ffd8291e65d1b66c89fbcc0bb34225e)() const` | |
Public attributes
-----------------
### diagonal
```
::tensorflow::Output diagonal
```
### operation
```
Operation operation
```
Public functions
----------------
### DiagPart
```
DiagPart(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizedBatchNormWithGlobalNormalization tensorflow::ops::QuantizedBatchNormWithGlobalNormalization
==========================================================
`#include <nn_ops.h>`
Quantized Batch normalization.
Summary
-------
This op is deprecated and will be removed in the future. Prefer `tf.nn.batch_normalization`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* t: A 4D input [Tensor](../tensor#classtensorflow_1_1_tensor).
* t\_min: The value represented by the lowest quantized input.
* t\_max: The value represented by the highest quantized input.
* m: A 1D mean [Tensor](../tensor#classtensorflow_1_1_tensor) with size matching the last dimension of t. This is the first output from tf.nn.moments, or a saved moving average thereof.
* m\_min: The value represented by the lowest quantized mean.
* m\_max: The value represented by the highest quantized mean.
* v: A 1D variance [Tensor](../tensor#classtensorflow_1_1_tensor) with size matching the last dimension of t. This is the second output from tf.nn.moments, or a saved moving average thereof.
* v\_min: The value represented by the lowest quantized variance.
* v\_max: The value represented by the highest quantized variance.
* beta: A 1D beta [Tensor](../tensor#classtensorflow_1_1_tensor) with size matching the last dimension of t. An offset to be added to the normalized tensor.
* beta\_min: The value represented by the lowest quantized offset.
* beta\_max: The value represented by the highest quantized offset.
* gamma: A 1D gamma [Tensor](../tensor#classtensorflow_1_1_tensor) with size matching the last dimension of t. If "scale\_after\_normalization" is true, this tensor will be multiplied with the normalized tensor.
* gamma\_min: The value represented by the lowest quantized gamma.
* gamma\_max: The value represented by the highest quantized gamma.
* variance\_epsilon: A small float number to avoid dividing by 0.
* scale\_after\_normalization: A bool indicating whether the resulted tensor needs to be multiplied with gamma.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` result
* `[Output](../output#classtensorflow_1_1_output)` result\_min
* `[Output](../output#classtensorflow_1_1_output)` result\_max
| Constructors and Destructors |
| --- |
| `[QuantizedBatchNormWithGlobalNormalization](#classtensorflow_1_1ops_1_1_quantized_batch_norm_with_global_normalization_1a06c79c043a3a55b798944a5ae0a0f148)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) t, ::[tensorflow::Input](../input#classtensorflow_1_1_input) t_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) t_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) m_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) v_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) beta_max, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gamma, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gamma_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gamma_max, DataType out_type, float variance_epsilon, bool scale_after_normalization)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_batch_norm_with_global_normalization_1a84804acca133131cda9e9235b954f9af)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[result](#classtensorflow_1_1ops_1_1_quantized_batch_norm_with_global_normalization_1ab4d42bdea55b03a105681930993cf3d4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[result\_max](#classtensorflow_1_1ops_1_1_quantized_batch_norm_with_global_normalization_1aacfdd86eadc8f7972ff620b36692ef19)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[result\_min](#classtensorflow_1_1ops_1_1_quantized_batch_norm_with_global_normalization_1a608925a87be94416e98c14506e98fb64)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### result
```
::tensorflow::Output result
```
### result\_max
```
::tensorflow::Output result_max
```
### result\_min
```
::tensorflow::Output result_min
```
Public functions
----------------
### QuantizedBatchNormWithGlobalNormalization
```
QuantizedBatchNormWithGlobalNormalization(
const ::tensorflow::Scope & scope,
::tensorflow::Input t,
::tensorflow::Input t_min,
::tensorflow::Input t_max,
::tensorflow::Input m,
::tensorflow::Input m_min,
::tensorflow::Input m_max,
::tensorflow::Input v,
::tensorflow::Input v_min,
::tensorflow::Input v_max,
::tensorflow::Input beta,
::tensorflow::Input beta_min,
::tensorflow::Input beta_max,
::tensorflow::Input gamma,
::tensorflow::Input gamma_min,
::tensorflow::Input gamma_max,
DataType out_type,
float variance_epsilon,
bool scale_after_normalization
)
```
tensorflow_cpp tensorflow::ops::Sin tensorflow::ops::Sin
====================
`#include <math_ops.h>`
Computes sine of x element-wise.
Summary
-------
Given an input tensor, this function computes sine of every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `(-inf, inf)` and output range is `[-1,1]`.
```
x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10, float("inf")])
tf.math.sin(x) ==> [nan -0.4121185 -0.47942555 0.84147096 0.9320391 -0.87329733 -0.54402107 nan]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Sin](#classtensorflow_1_1ops_1_1_sin_1ad24244db6cbc2de4c8ab2140cbfcbad9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sin_1aa3998bbb29d3fb863cd198b505716b1e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_sin_1acb031428bba0c2a2dd8a2bc128313a1b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sin_1aea7bc24a2376bc87452fdb804e008158)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sin_1a7b796f2c90b021454049587df98c059b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sin_1a3218073d77436ebbd9724e855d6b275d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Sin
```
Sin(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::ResourceApplyProximalGradientDescent tensorflow::ops::ResourceApplyProximalGradientDescent
=====================================================
`#include <training_ops.h>`
Update '\*var' as FOBOS algorithm with fixed learning rate.
Summary
-------
prox\_v = var - alpha \* delta var = sign(prox\_v)/(1+alpha\*l2) \* max{|prox\_v|-alpha\*l1,0}
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* alpha: Scaling factor. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* delta: The change.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1_1_attrs)`):
* use\_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[ResourceApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1abbddad3b19f5766ee3e968f1a6b9567f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta)` |
| `[ResourceApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1a1b5470e569118e2bf85f8a80d6040ee7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) alpha, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) delta, const [ResourceApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1af16b611d7b02d65580a0234c5b815121)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1aaa85fb3ffe460dccaefcf263dc6f95f3)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1a6f9bcba3123d814dc2aeed6987d46e8b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ResourceApplyProximalGradientDescent::Attrs](../../../struct/tensorflow/ops/resource-apply-proximal-gradient-descent/attrs) | Optional attribute setters for [ResourceApplyProximalGradientDescent](resource-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent). |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### ResourceApplyProximalGradientDescent
```
ResourceApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input delta
)
```
### ResourceApplyProximalGradientDescent
```
ResourceApplyProximalGradientDescent(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input alpha,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input delta,
const ResourceApplyProximalGradientDescent::Attrs & attrs
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::InTopK tensorflow::ops::InTopK
=======================
`#include <nn_ops.h>`
Says whether the targets are in the top `K` predictions.
Summary
-------
This outputs a `batch_size` bool array, an entry `out[i]` is `true` if the prediction for the target class is among the top `k` predictions among all predictions for example `i`. Note that the behavior of `[InTopK](in-top-k#classtensorflow_1_1ops_1_1_in_top_k)` differs from the `[TopK](top-k#classtensorflow_1_1ops_1_1_top_k)` op in its handling of ties; if multiple classes have the same prediction value and straddle the top-`k` boundary, all of those classes are considered to be in the top `k`.
More formally, let
\(predictions\_i\) be the predictions for all classes for example `i`, \(targets\_i\) be the target class for example `i`, \(out\_i\) be the output for example `i`,
$$out\_i = predictions\_{i, targets\_i} \in TopKIncludingTies(predictions\_i)$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* predictions: A `batch_size` x `classes` tensor.
* targets: A `batch_size` vector of class ids.
* k: Number of top elements to look at for computing precision.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Computed Precision at `k` as a `bool [Tensor](../tensor#classtensorflow_1_1_tensor)`.
| Constructors and Destructors |
| --- |
| `[InTopK](#classtensorflow_1_1ops_1_1_in_top_k_1a377574cc533f3b91fea7345442e1998f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) predictions, ::[tensorflow::Input](../input#classtensorflow_1_1_input) targets, int64 k)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_in_top_k_1afe7a77dd6f17c474fce97861cab29527)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[precision](#classtensorflow_1_1ops_1_1_in_top_k_1a43116d147476cd8f69ce01d5c3c9f915)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_in_top_k_1a135e20737a15b73e8336cea65b60ad87)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_in_top_k_1a0b88d86f83d7e064c8c3189793a3400b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_in_top_k_1a63713331ec8812a5470f740a7fd9f5df)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### precision
```
::tensorflow::Output precision
```
Public functions
----------------
### InTopK
```
InTopK(
const ::tensorflow::Scope & scope,
::tensorflow::Input predictions,
::tensorflow::Input targets,
int64 k
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::ApproximateEqual tensorflow::ops::ApproximateEqual
=================================
`#include <math_ops.h>`
Returns the truth value of abs(x-y) < tolerance element-wise.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[ApproximateEqual](#classtensorflow_1_1ops_1_1_approximate_equal_1ae34557dc105fbbef2d26f6d0bdbabc2c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| `[ApproximateEqual](#classtensorflow_1_1ops_1_1_approximate_equal_1a23edb14e02d1b083b8e3efa5ead76d2d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, const [ApproximateEqual::Attrs](../../../struct/tensorflow/ops/approximate-equal/attrs#structtensorflow_1_1ops_1_1_approximate_equal_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_approximate_equal_1af517cf6c2807f3c6586facbf69cd0e68)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_approximate_equal_1a6c1780e5aa185b3b2cfd7887a1998b40)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_approximate_equal_1a4b6e63d06e21bb282c973aeae6961973)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_approximate_equal_1a47f092973d15a439df6a78d04f1a313f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_approximate_equal_1a587da19cc92bc9474ace6fdd911e4610)() const` | |
| Public static functions |
| --- |
| `[Tolerance](#classtensorflow_1_1ops_1_1_approximate_equal_1a97ed9ba462b24ea8bad2bcc2ba45d999)(float x)` | `[Attrs](../../../struct/tensorflow/ops/approximate-equal/attrs#structtensorflow_1_1ops_1_1_approximate_equal_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ApproximateEqual::Attrs](../../../struct/tensorflow/ops/approximate-equal/attrs) | Optional attribute setters for [ApproximateEqual](approximate-equal#classtensorflow_1_1ops_1_1_approximate_equal). |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### ApproximateEqual
```
ApproximateEqual(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### ApproximateEqual
```
ApproximateEqual(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
const ApproximateEqual::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Tolerance
```
Attrs Tolerance(
float x
)
```
tensorflow_cpp tensorflow::ops::Switch tensorflow::ops::Switch
=======================
`#include <control_flow_ops.h>`
Forwards `data` to the output port determined by `pred`.
Summary
-------
If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, the data goes to `output_false`.
See also `[RefSwitch](ref-switch#classtensorflow_1_1ops_1_1_ref_switch)` and `[Merge](merge#classtensorflow_1_1ops_1_1_merge)`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* data: The tensor to be forwarded to the appropriate output.
* pred: A scalar that specifies which output port will receive data.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` output\_false: If `pred` is false, data will be forwarded to this output.
* `[Output](../output#classtensorflow_1_1_output)` output\_true: If `pred` is true, data will be forwarded to this output.
| Constructors and Destructors |
| --- |
| `[Switch](#classtensorflow_1_1ops_1_1_switch_1aaf5ed723a26cd3b4c917701508ff4c50)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pred)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_switch_1a6cf3e40f6e518afc71bad3f6a394199a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output\_false](#classtensorflow_1_1ops_1_1_switch_1a806a04c10d9920f2f1f3b9b503d24a5c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[output\_true](#classtensorflow_1_1ops_1_1_switch_1a84ad96bc82bdb0ce2af402225707ca0e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
Public attributes
-----------------
### operation
```
Operation operation
```
### output\_false
```
::tensorflow::Output output_false
```
### output\_true
```
::tensorflow::Output output_true
```
Public functions
----------------
### Switch
```
Switch(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input pred
)
```
tensorflow_cpp tensorflow::ops::BroadcastDynamicShape tensorflow::ops::BroadcastDynamicShape
======================================
`#include <array_ops.h>`
Return the shape of s0 op s1 with broadcast.
Summary
-------
Given `s0` and `s1`, tensors that represent shapes, compute `r0`, the broadcasted shape. `s0`, `s1` and `r0` are all integer vectors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The r0 tensor.
| Constructors and Destructors |
| --- |
| `[BroadcastDynamicShape](#classtensorflow_1_1ops_1_1_broadcast_dynamic_shape_1a6672d4b43b8122a2ebadcb84b0a33ffa)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) s0, ::[tensorflow::Input](../input#classtensorflow_1_1_input) s1)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_broadcast_dynamic_shape_1a2812a907f6572e464a52d236c77632cd)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[r0](#classtensorflow_1_1ops_1_1_broadcast_dynamic_shape_1a8f8ea2cc676b86d7bc6f4e9466033607)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_broadcast_dynamic_shape_1a315dcdda63283a0ff7e83587d69c6d18)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_broadcast_dynamic_shape_1af1253260f384caf7bd281e19ff4350df)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_broadcast_dynamic_shape_1a69e5f15b0ae2eaf6ce1912459a56e84e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### r0
```
::tensorflow::Output r0
```
Public functions
----------------
### BroadcastDynamicShape
```
BroadcastDynamicShape(
const ::tensorflow::Scope & scope,
::tensorflow::Input s0,
::tensorflow::Input s1
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::BarrierInsertMany tensorflow::ops::BarrierInsertMany
==================================
`#include <data_flow_ops.h>`
For each key, assigns the respective value to the specified component.
Summary
-------
If a key is not found in the barrier, this operation will create a new incomplete element. If a key is found in the barrier, and the element already has a value at component\_index, this operation will fail with INVALID\_ARGUMENT, and leave the barrier in an undefined state.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a barrier.
* keys: A one-dimensional tensor of keys, with length n.
* values: An any-dimensional tensor of values, which are associated with the respective keys. The 0th dimension must have length n.
* component\_index: The component of the barrier elements that is being assigned.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[BarrierInsertMany](#classtensorflow_1_1ops_1_1_barrier_insert_many_1a8ee6cfc13fdf57f11e86b4d6692898b8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::Input](../input#classtensorflow_1_1_input) keys, ::[tensorflow::Input](../input#classtensorflow_1_1_input) values, int64 component_index)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_barrier_insert_many_1aa3425272e66a4448615caa6b258f4a66)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_barrier_insert_many_1ad8ad6d9598344b4090c7d2af0ace852d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### BarrierInsertMany
```
BarrierInsertMany(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle,
::tensorflow::Input keys,
::tensorflow::Input values,
int64 component_index
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::MatrixSetDiagV2 tensorflow::ops::MatrixSetDiagV2
================================
`#include <array_ops.h>`
Returns a batched matrix tensor with new batched diagonal values.
Summary
-------
Given `input` and `diagonal`, this operation returns a tensor with the same shape and values as `input`, except for the specified diagonals of the innermost matrices. These will be overwritten by the values in `diagonal`.
`input` has `r+1` dimensions `[I, J, ..., L, M, N]`. When `k` is scalar or `k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`. Otherwise, it has `r+1` dimensions `[I, J, ..., L, num_diags, max_diag_len]`. `num_diags` is the number of diagonals, `num_diags = k[1] - k[0] + 1`. `max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`, `max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))`
The output is a tensor of rank `k+1` with dimensions `[I, J, ..., L, M, N]`. If `k` is scalar or `k[0] == k[1]`:
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
input[i, j, ..., l, m, n] ; otherwise
```
Otherwise,
```
output[i, j, ..., l, m, n]
= diagonal[i, j, ..., l, diag_index, index_in_diag] ; if k[0] <= d <= k[1]
input[i, j, ..., l, m, n] ; otherwise
```
where `d = n - m`
, `diag_index = k[1] - d`
, and `index_in_diag = n - max(d, 0)`
. For example:
```
# The main diagonal.
input = np.array([[[7, 7, 7, 7], # Input shape: (2, 3, 4)
[7, 7, 7, 7],
[7, 7, 7, 7]],
[[7, 7, 7, 7],
[7, 7, 7, 7],
[7, 7, 7, 7]]])
diagonal = np.array([[1, 2, 3], # Diagonal shape: (2, 3)
[4, 5, 6]])
tf.matrix_set_diag(diagonal) ==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)
[7, 2, 7, 7],
[7, 7, 3, 7]],
[[4, 7, 7, 7],
[7, 5, 7, 7],
[7, 7, 6, 7]]]
```
```
# A superdiagonal (per batch).
tf.matrix_set_diag(diagonal, k = 1)
==> [[[7, 1, 7, 7], # Output shape: (2, 3, 4)
[7, 7, 2, 7],
[7, 7, 7, 3]],
[[7, 4, 7, 7],
[7, 7, 5, 7],
[7, 7, 7, 6]]]
```
```
# A band of diagonals.
diagonals = np.array([[[1, 2, 3], # Diagonal shape: (2, 2, 3)
[4, 5, 0]],
[[6, 1, 2],
[3, 4, 0]]])
tf.matrix_set_diag(diagonals, k = (-1, 0))
==> [[[1, 7, 7, 7], # Output shape: (2, 3, 4)
[4, 2, 7, 7],
[0, 5, 3, 7]],
[[6, 7, 7, 7],
[3, 1, 7, 7],
[7, 4, 2, 7]]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: Rank `r+1`, where `r >= 1`.
* diagonal: Rank `r` when `k` is an integer or `k[0] == k[1]`. Otherwise, it has rank `r+1`. `k >= 1`.
* k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. `k` can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. `k[0]` must not be larger than `k[1]`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Rank `r+1`, with `output.shape = input.shape`.
| Constructors and Destructors |
| --- |
| `[MatrixSetDiagV2](#classtensorflow_1_1ops_1_1_matrix_set_diag_v2_1a438f858712bda6df180ee19d8f278bf4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) diagonal, ::[tensorflow::Input](../input#classtensorflow_1_1_input) k)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_matrix_set_diag_v2_1a433c91a80772823c3acd4729a873900f)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_matrix_set_diag_v2_1a390fc69019f7170f80f7c4c3acb12cee)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_matrix_set_diag_v2_1ab0f95dc9ddcb2221701f55c8caddcdb1)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_set_diag_v2_1a333c742af8203776572da9009d8c0930)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_set_diag_v2_1a0574bd8260d99f8d93fa3a0cb880f0fa)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### MatrixSetDiagV2
```
MatrixSetDiagV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input diagonal,
::tensorflow::Input k
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::QuantizedAdd tensorflow::ops::QuantizedAdd
=============================
`#include <math_ops.h>`
Returns x + y element-wise, working on quantized buffers.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* min\_x: The float value that the lowest quantized `x` value represents.
* max\_x: The float value that the highest quantized `x` value represents.
* min\_y: The float value that the lowest quantized `y` value represents.
* max\_y: The float value that the highest quantized `y` value represents.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` z
* `[Output](../output#classtensorflow_1_1_output)` min\_z: The float value that the lowest quantized output value represents.
* `[Output](../output#classtensorflow_1_1_output)` max\_z: The float value that the highest quantized output value represents.
*NOTE*: `[QuantizedAdd](quantized-add#classtensorflow_1_1ops_1_1_quantized_add)` supports limited forms of broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html)
| Constructors and Destructors |
| --- |
| `[QuantizedAdd](#classtensorflow_1_1ops_1_1_quantized_add_1a621cf3cc36853c0430685e0ededdb067)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_y)` |
| `[QuantizedAdd](#classtensorflow_1_1ops_1_1_quantized_add_1a57f7593ed6b7624a1d2cb0e786658078)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min_y, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_y, const [QuantizedAdd::Attrs](../../../struct/tensorflow/ops/quantized-add/attrs#structtensorflow_1_1ops_1_1_quantized_add_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[max\_z](#classtensorflow_1_1ops_1_1_quantized_add_1aa6b32102b5d9cae9995b2a21ace0e734)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[min\_z](#classtensorflow_1_1ops_1_1_quantized_add_1aaa43907a5a663e0ef036a91d223208a2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantized_add_1a23cd1345aab819233c50f05efd30b8be)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_quantized_add_1a3477fdd6d636f728c0c5267923f5cf43)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Toutput](#classtensorflow_1_1ops_1_1_quantized_add_1acba69e1c883470c315eb3688e1f4de1e)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/quantized-add/attrs#structtensorflow_1_1ops_1_1_quantized_add_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizedAdd::Attrs](../../../struct/tensorflow/ops/quantized-add/attrs) | Optional attribute setters for [QuantizedAdd](quantized-add#classtensorflow_1_1ops_1_1_quantized_add). |
Public attributes
-----------------
### max\_z
```
::tensorflow::Output max_z
```
### min\_z
```
::tensorflow::Output min_z
```
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### QuantizedAdd
```
QuantizedAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
::tensorflow::Input min_x,
::tensorflow::Input max_x,
::tensorflow::Input min_y,
::tensorflow::Input max_y
)
```
### QuantizedAdd
```
QuantizedAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y,
::tensorflow::Input min_x,
::tensorflow::Input max_x,
::tensorflow::Input min_y,
::tensorflow::Input max_y,
const QuantizedAdd::Attrs & attrs
)
```
Public static functions
-----------------------
### Toutput
```
Attrs Toutput(
DataType x
)
```
tensorflow_cpp tensorflow::ops::FusedBatchNormGradV2 tensorflow::ops::FusedBatchNormGradV2
=====================================
`#include <nn_ops.h>`
Gradient for batch normalization.
Summary
-------
Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* y\_backprop: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to y.
* x: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for input data.
* scale: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for scaling factor, to scale the normalized x.
* reserve\_space\_1: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch mean to be reused in gradient computation. When is\_training is False, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the population mean to be reused in both 1st and 2nd order gradient computation.
* reserve\_space\_2: When is\_training is True, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the computed batch variance (inverted variance in the cuDNN case) to be reused in gradient computation. When is\_training is False, a 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the population variance to be reused in both 1st and 2nd order gradient computation.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)`):
* epsilon: A small float number added to the variance of x.
* data\_format: The data format for y\_backprop, x, x\_backprop. Either "NHWC" (default) or "NCHW".
* is\_training: A bool value to indicate the operation is for training (default) or inference.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` x\_backprop: A 4D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to x.
* `[Output](../output#classtensorflow_1_1_output)` scale\_backprop: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to scale.
* `[Output](../output#classtensorflow_1_1_output)` offset\_backprop: A 1D [Tensor](../tensor#classtensorflow_1_1_tensor) for the gradient with respect to offset.
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_3: Unused placeholder to match the mean input in [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm).
* `[Output](../output#classtensorflow_1_1_output)` reserve\_space\_4: Unused placeholder to match the variance input in [FusedBatchNorm](fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm).
| Constructors and Destructors |
| --- |
| `[FusedBatchNormGradV2](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a86c8eb15c1fa6e765c1d7648e45357f4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y_backprop, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_2)` |
| `[FusedBatchNormGradV2](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1ad137349082f7495a1b3ab2c72854a8b5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y_backprop, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scale, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) reserve_space_2, const [FusedBatchNormGradV2::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[offset\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a573a935b4cc1b1bb19d4a2d75ebbf13d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a4742048a5a4d494a534ebb4253cef274)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[reserve\_space\_3](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1aed1a4427bd98ce56394aef062fb9cecb)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[reserve\_space\_4](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a5cadd7c94138dc3e294245ca7a0cb18f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[scale\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1ad01de4d69bdfca21353023d588abf004)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[x\_backprop](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a5eecc4926429818678c3e35d36b11930)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a7143f83d7e6e604147b10e6be3b7f5ba)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)` |
| `[Epsilon](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a991011a32051ef190fd0028fbb5f7fb5)(float x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)` |
| `[IsTraining](#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1a87dc995a72a9c52136f68d7eb2b8b588)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v2/attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::FusedBatchNormGradV2::Attrs](../../../struct/tensorflow/ops/fused-batch-norm-grad-v2/attrs) | Optional attribute setters for [FusedBatchNormGradV2](fused-batch-norm-grad-v2#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2). |
Public attributes
-----------------
### offset\_backprop
```
::tensorflow::Output offset_backprop
```
### operation
```
Operation operation
```
### reserve\_space\_3
```
::tensorflow::Output reserve_space_3
```
### reserve\_space\_4
```
::tensorflow::Output reserve_space_4
```
### scale\_backprop
```
::tensorflow::Output scale_backprop
```
### x\_backprop
```
::tensorflow::Output x_backprop
```
Public functions
----------------
### FusedBatchNormGradV2
```
FusedBatchNormGradV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input y_backprop,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input reserve_space_1,
::tensorflow::Input reserve_space_2
)
```
### FusedBatchNormGradV2
```
FusedBatchNormGradV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input y_backprop,
::tensorflow::Input x,
::tensorflow::Input scale,
::tensorflow::Input reserve_space_1,
::tensorflow::Input reserve_space_2,
const FusedBatchNormGradV2::Attrs & attrs
)
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
### Epsilon
```
Attrs Epsilon(
float x
)
```
### IsTraining
```
Attrs IsTraining(
bool x
)
```
tensorflow_cpp tensorflow::ops::ExtractJpegShape tensorflow::ops::ExtractJpegShape
=================================
`#include <image_ops.h>`
Extract the shape information of a JPEG-encoded image.
Summary
-------
This op only parses the image header, so it is much faster than [DecodeJpeg](decode-jpeg#classtensorflow_1_1ops_1_1_decode_jpeg).
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* contents: 0-D. The JPEG-encoded image.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/extract-jpeg-shape/attrs#structtensorflow_1_1ops_1_1_extract_jpeg_shape_1_1_attrs)`):
* output\_type: (Optional) The output type of the operation (int32 or int64). Defaults to int32.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D. The image shape with format [height, width, channels].
| Constructors and Destructors |
| --- |
| `[ExtractJpegShape](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1a64ffa4ea238d244c52716d482a64aeb4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents)` |
| `[ExtractJpegShape](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1a5c8f40a8498a2351175856f88c12df3b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, const [ExtractJpegShape::Attrs](../../../struct/tensorflow/ops/extract-jpeg-shape/attrs#structtensorflow_1_1ops_1_1_extract_jpeg_shape_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[image\_shape](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1a119b30980cd88aeb7e800ef248fe0ef9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1a93aaacf0ede8a075a9e7cbaae6ec1851)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1afbd0f7b3f51267da79a8d34265bc3cd3)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1a93f3c5b2f3246fb2633916edd1a51b2a)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1aa148b0c56486902349d41f68d956164d)() const` | |
| Public static functions |
| --- |
| `[OutputType](#classtensorflow_1_1ops_1_1_extract_jpeg_shape_1a74c981eaa0a2024456fbe7c35c65b01e)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/extract-jpeg-shape/attrs#structtensorflow_1_1ops_1_1_extract_jpeg_shape_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::ExtractJpegShape::Attrs](../../../struct/tensorflow/ops/extract-jpeg-shape/attrs) | Optional attribute setters for [ExtractJpegShape](extract-jpeg-shape#classtensorflow_1_1ops_1_1_extract_jpeg_shape). |
Public attributes
-----------------
### image\_shape
```
::tensorflow::Output image_shape
```
### operation
```
Operation operation
```
Public functions
----------------
### ExtractJpegShape
```
ExtractJpegShape(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents
)
```
### ExtractJpegShape
```
ExtractJpegShape(
const ::tensorflow::Scope & scope,
::tensorflow::Input contents,
const ExtractJpegShape::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### OutputType
```
Attrs OutputType(
DataType x
)
```
tensorflow_cpp tensorflow::ops::Tan tensorflow::ops::Tan
====================
`#include <math_ops.h>`
Computes tan of x element-wise.
Summary
-------
Given an input tensor, this function computes tangent of every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `(-inf, inf)` and output range is `(-inf, inf)`. If input lies outside the boundary, `nan` is returned.
```
x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.tan(x) ==> [nan 0.45231566 -0.5463025 1.5574077 2.572152 -1.7925274 0.32097113 nan]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[Tan](#classtensorflow_1_1ops_1_1_tan_1ab55fbba17be79b5811f49b2728dd4cbc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_tan_1afb37a60014fe1eab1803711757f8c027)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_tan_1a43c28a4fa5ec96c4d509e1b31eb2bd5b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_tan_1a284777905469857d2f3aefaa520a991d)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_tan_1a8fec1bcffaaefa2d23940a641ec04cbf)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_tan_1a0bd2bfaa65fd5352902950aba2a2a29e)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### Tan
```
Tan(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QueueIsClosedV2 tensorflow::ops::QueueIsClosedV2
================================
`#include <data_flow_ops.h>`
Returns true if queue is closed.
Summary
-------
This operation returns true if the queue is closed and false if the queue is open.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* handle: The handle to a queue.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The is\_closed tensor.
| Constructors and Destructors |
| --- |
| `[QueueIsClosedV2](#classtensorflow_1_1ops_1_1_queue_is_closed_v2_1a45ba41a743bd847e4a69e17fe5e603d2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` |
| Public attributes |
| --- |
| `[is\_closed](#classtensorflow_1_1ops_1_1_queue_is_closed_v2_1a95f6be9de7efd5fccafff82b4dbf33a3)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_queue_is_closed_v2_1aa021c2ea097d2717bfe96ab5e051f311)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_queue_is_closed_v2_1aed8049b4cd80f3a25c0d8b1eab7b4390)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_queue_is_closed_v2_1acc14a8b606192bbe4af68d4d55260ed2)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_queue_is_closed_v2_1a2a5b81cd81937169e2206632cf1d826a)() const` | |
Public attributes
-----------------
### is\_closed
```
::tensorflow::Output is_closed
```
### operation
```
Operation operation
```
Public functions
----------------
### QueueIsClosedV2
```
QueueIsClosedV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input handle
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::RefSelect tensorflow::ops::RefSelect
==========================
`#include <control_flow_ops.h>`
Forwards the `index`th element of `inputs` to `output`.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* index: A scalar that determines the input that gets selected.
* inputs: A list of ref tensors, one of which will be forwarded to `output`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The forwarded tensor.
| Constructors and Destructors |
| --- |
| `[RefSelect](#classtensorflow_1_1ops_1_1_ref_select_1abed277c64b2841b7de2598dbaf9e05fe)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) index, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) inputs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_ref_select_1a788cafc3e7b5b8f51a360199a0851186)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_ref_select_1a5a8e6cb42d7e6790beddf4a20fd8d02b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_ref_select_1a7941bd675a31248e3ad9eb2e8a66c040)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ref_select_1a120a72a9abdfba8558928e029515286b)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ref_select_1a264243efd34cc1e87f84bbd19ae8ae85)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### RefSelect
```
RefSelect(
const ::tensorflow::Scope & scope,
::tensorflow::Input index,
::tensorflow::InputList inputs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::SaveSlices tensorflow::ops::SaveSlices
===========================
`#include <io_ops.h>`
Saves input tensors slices to disk.
Summary
-------
This is like `[Save](save#classtensorflow_1_1ops_1_1_save)` except that tensors can be listed in the saved file as being a slice of a larger tensor. `shapes_and_slices` specifies the shape of the larger tensor and the slice that this tensor covers. `shapes_and_slices` must have as many elements as `tensor_names`.
Elements of the `shapes_and_slices` input must either be:
* The empty string, in which case the corresponding tensor is saved normally.
* A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the `dimI` are the dimensions of the larger tensor and `slice-spec` specifies what part is covered by the tensor to save.
`slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1` where each `sliceI` is either:
* The string `-` meaning that the slice covers all indices of this dimension
* `start,length` where `start` and `length` are integers. In that case the slice covers `length` indices starting at `start`.
See also `[Save](save#classtensorflow_1_1ops_1_1_save)`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* filename: Must have a single element. The name of the file to which we write the tensor.
* tensor\_names: Shape `[N]`. The names of the tensors to be saved.
* shapes\_and\_slices: Shape `[N]`. The shapes and slice specifications to use when saving the tensors.
* data: `N` tensors to save.
Returns:
* the created `[Operation](../operation#classtensorflow_1_1_operation)`
| Constructors and Destructors |
| --- |
| `[SaveSlices](#classtensorflow_1_1ops_1_1_save_slices_1a348703b8b3b5deaa67138609a3e7fa0c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) filename, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor_names, ::[tensorflow::Input](../input#classtensorflow_1_1_input) shapes_and_slices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) data)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_save_slices_1a0ef740836d01295141e4a0c6cfc9d4a2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public functions |
| --- |
| `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_save_slices_1a31b63fe266dfcc7f28eae47f400212b3)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
Public functions
----------------
### SaveSlices
```
SaveSlices(
const ::tensorflow::Scope & scope,
::tensorflow::Input filename,
::tensorflow::Input tensor_names,
::tensorflow::Input shapes_and_slices,
::tensorflow::InputList data
)
```
### operator::tensorflow::Operation
```
operator::tensorflow::Operation() const
```
tensorflow_cpp tensorflow::ops::StringNGrams tensorflow::ops::StringNGrams
=============================
`#include <string_ops.h>`
Creates ngrams from ragged string data.
Summary
-------
This op accepts a ragged tensor with 1 ragged dimension containing only strings and outputs a ragged tensor with 1 ragged dimension containing ngrams of that string, joined along the innermost axis.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* data: The values tensor of the ragged string tensor to make ngrams out of. Must be a 1D string tensor.
* data\_splits: The splits tensor of the ragged string tensor to make ngrams out of.
* separator: The string to append between elements of the token. Use "" for no separator.
* ngram\_widths: The sizes of the ngrams to create.
* left\_pad: The string to use to pad the left side of the ngram sequence. Only used if pad\_width != 0.
* right\_pad: The string to use to pad the right side of the ngram sequence. Only used if pad\_width != 0.
* pad\_width: The number of padding elements to add to each side of each sequence. Note that padding will never be greater than 'ngram\_widths'-1 regardless of this value. If `pad_width=-1`, then add `max(ngram_widths)-1` elements.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` ngrams: The values tensor of the output ngrams ragged tensor.
* `[Output](../output#classtensorflow_1_1_output)` ngrams\_splits: The splits tensor of the output ngrams ragged tensor.
| Constructors and Destructors |
| --- |
| `[StringNGrams](#classtensorflow_1_1ops_1_1_string_n_grams_1a52a1f08705af6ba58d3607b809b3f835)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data_splits, StringPiece separator, const gtl::ArraySlice< int > & ngram_widths, StringPiece left_pad, StringPiece right_pad, int64 pad_width, bool preserve_short_sequences)` |
| Public attributes |
| --- |
| `[ngrams](#classtensorflow_1_1ops_1_1_string_n_grams_1a447bd501492adc42e453473dd818baf0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[ngrams\_splits](#classtensorflow_1_1ops_1_1_string_n_grams_1af326c6b4d4d0f53e7b7360546c807526)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_string_n_grams_1a96bbeebe04843441f8b36c587ed4f1c9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
Public attributes
-----------------
### ngrams
```
::tensorflow::Output ngrams
```
### ngrams\_splits
```
::tensorflow::Output ngrams_splits
```
### operation
```
Operation operation
```
Public functions
----------------
### StringNGrams
```
StringNGrams(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input data_splits,
StringPiece separator,
const gtl::ArraySlice< int > & ngram_widths,
StringPiece left_pad,
StringPiece right_pad,
int64 pad_width,
bool preserve_short_sequences
)
```
tensorflow_cpp tensorflow::ops::Where3 tensorflow::ops::Where3
=======================
`#include <math_ops.h>`
Selects elements from `x` or `y`, depending on `condition`.
Summary
-------
The `x`, and `y` tensors must all have the same shape, and the output will also have that shape.
The `condition` tensor must be a scalar if `x` and `y` are scalars. If `x` and `y` are vectors or higher rank, then `condition` must be either a scalar, a vector with size matching the first dimension of `x`, or must have the same shape as `x`.
The `condition` tensor acts as a mask that chooses, based on the value at each element, whether the corresponding element / row in the output should be taken from `x` (if true) or `y` (if false).
If `condition` is a vector and `x` and `y` are higher rank matrices, then it chooses which row (outer dimension) to copy from `x` and `y`. If `condition` has the same shape as `x` and `y`, then it chooses which element to copy from `x` and `y`.
For example:
```
# 'condition' tensor is [[True, False]
# [False, True]]
# 't' is [[1, 2],
# [3, 4]]
# 'e' is [[5, 6],
# [7, 8]]
select(condition, t, e) # => [[1, 6], [7, 4]]
```
```
# 'condition' tensor is [True, False]
# 't' is [[1, 2],
# [3, 4]]
# 'e' is [[5, 6],
# [7, 8]]
select(condition, t, e) ==> [[1, 2],
[7, 8]]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* x: = A `[Tensor](../tensor#classtensorflow_1_1_tensor)` which may have the same shape as `condition`. If `condition` is rank 1, `x` may have higher rank, but its first dimension must match the size of `condition`.
* y: = A `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same type and shape as `x`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: = A `[Tensor](../tensor#classtensorflow_1_1_tensor)` with the same type and shape as `x` and `y`.
| Constructors and Destructors |
| --- |
| `[Where3](#classtensorflow_1_1ops_1_1_where3_1a1e043e7f8493b555a94d106084a64a32)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) condition, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_where3_1a9b749e1046fbe4c39075a2b037391cf2)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_where3_1a07742c7ad2705b0fa9b9cc9e59eca41b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_where3_1aacfd2a5bd041b46bc2179d3e9ac5c0c6)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_where3_1a7fcabeeb211b239288d028b587a88e54)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_where3_1aedd6e529c7127af0c5af333ded627ab3)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Where3
```
Where3(
const ::tensorflow::Scope & scope,
::tensorflow::Input condition,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV4Grad tensorflow::ops::QuantizeAndDequantizeV4Grad
============================================
`#include <array_ops.h>`
Returns the gradient of `[QuantizeAndDequantizeV4](quantize-and-dequantize-v4#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4)`.
Summary
-------
Returns a gradient of 1 for inputs that are within the quantization range, or 0 otherwise.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)` input\_backprop
* `[Output](../output#classtensorflow_1_1_output)` input\_min\_backprop
* `[Output](../output#classtensorflow_1_1_output)` input\_max\_backprop
| Constructors and Destructors |
| --- |
| `[QuantizeAndDequantizeV4Grad](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1a26d0948b45723231583b908e0c9a2a69)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max)` |
| `[QuantizeAndDequantizeV4Grad](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1af363a4e4e568742aec3d5dec7fed5f27)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) gradients, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, const [QuantizeAndDequantizeV4Grad::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4-grad/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[input\_backprop](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1a9aa34bae5ae453ca0eaac140656047b8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[input\_max\_backprop](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1a53d0c27e8250e5c926386053a3cdc617)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[input\_min\_backprop](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1a51aa85a675987f4e141b4289d070db87)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1ab6e9baab3384dedc9b41d13f0469e5d5)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1a8af4c4b69e85336f269ff298ba777487)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4-grad/attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::QuantizeAndDequantizeV4Grad::Attrs](../../../struct/tensorflow/ops/quantize-and-dequantize-v4-grad/attrs) | Optional attribute setters for [QuantizeAndDequantizeV4Grad](quantize-and-dequantize-v4-grad#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad). |
Public attributes
-----------------
### input\_backprop
```
::tensorflow::Output input_backprop
```
### input\_max\_backprop
```
::tensorflow::Output input_max_backprop
```
### input\_min\_backprop
```
::tensorflow::Output input_min_backprop
```
### operation
```
Operation operation
```
Public functions
----------------
### QuantizeAndDequantizeV4Grad
```
QuantizeAndDequantizeV4Grad(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max
)
```
### QuantizeAndDequantizeV4Grad
```
QuantizeAndDequantizeV4Grad(
const ::tensorflow::Scope & scope,
::tensorflow::Input gradients,
::tensorflow::Input input,
::tensorflow::Input input_min,
::tensorflow::Input input_max,
const QuantizeAndDequantizeV4Grad::Attrs & attrs
)
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
tensorflow_cpp tensorflow::ops::StringSplitV2 tensorflow::ops::StringSplitV2
==============================
`#include <string_ops.h>`
Split elements of `source` based on `sep` into a `SparseTensor`.
Summary
-------
Let N be the size of source (typically N will be the batch size). Split each element of `source` based on `sep` and return a `SparseTensor` containing the split tokens. [Empty](empty#classtensorflow_1_1ops_1_1_empty) tokens are ignored.
For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', then the output will be
```
st.indices = [0, 0;
0, 1;
1, 0;
1, 1;
1, 2]
st.shape = [2, 3]
st.values = ['hello', 'world', 'a', 'b', 'c']
```
If `sep` is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings. For example, source of `"1\<\>2\<\>\<\>3"` and sep of `"\<\>"` returns `["1", "2", "", "3"]`. If `sep` is None or an empty string, consecutive whitespace are regarded as a single separator, and the result will contain no empty strings at the startor end if the string has leading or trailing whitespace.
Note that the above mentioned behavior matches python's str.split.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: `1-D` string `[Tensor](../tensor#classtensorflow_1_1_tensor)`, the strings to split.
* sep: `0-D` string `[Tensor](../tensor#classtensorflow_1_1_tensor)`, the delimiter character.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/string-split-v2/attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs)`):
* maxsplit: An `int`. If `maxsplit > 0`, limit of the split of the result.
Returns:
* `[Output](../output#classtensorflow_1_1_output)` indices
* `[Output](../output#classtensorflow_1_1_output)` values
* `[Output](../output#classtensorflow_1_1_output)` shape
| Constructors and Destructors |
| --- |
| `[StringSplitV2](#classtensorflow_1_1ops_1_1_string_split_v2_1acbea51cb12f95ef6cae1972ae134e7ac)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sep)` |
| `[StringSplitV2](#classtensorflow_1_1ops_1_1_string_split_v2_1a63b63775de3ac1b5830b860233d56cbc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sep, const [StringSplitV2::Attrs](../../../struct/tensorflow/ops/string-split-v2/attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[indices](#classtensorflow_1_1ops_1_1_string_split_v2_1afd84236fdcaab70d550ed4c31069c70b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[operation](#classtensorflow_1_1ops_1_1_string_split_v2_1a58af1d625de74aabfd6fbf24fc8f5000)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[shape](#classtensorflow_1_1ops_1_1_string_split_v2_1af40d55ff0d2df1679c54c1d41e13dccf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| `[values](#classtensorflow_1_1ops_1_1_string_split_v2_1a06c7c35d77269fee3efbc2f4a6987c30)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public static functions |
| --- |
| `[Maxsplit](#classtensorflow_1_1ops_1_1_string_split_v2_1a33e93526de570b25c067a8a35545e5b2)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/string-split-v2/attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::StringSplitV2::Attrs](../../../struct/tensorflow/ops/string-split-v2/attrs) | Optional attribute setters for [StringSplitV2](string-split-v2#classtensorflow_1_1ops_1_1_string_split_v2). |
Public attributes
-----------------
### indices
```
::tensorflow::Output indices
```
### operation
```
Operation operation
```
### shape
```
::tensorflow::Output shape
```
### values
```
::tensorflow::Output values
```
Public functions
----------------
### StringSplitV2
```
StringSplitV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input sep
)
```
### StringSplitV2
```
StringSplitV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input sep,
const StringSplitV2::Attrs & attrs
)
```
Public static functions
-----------------------
### Maxsplit
```
Attrs Maxsplit(
int64 x
)
```
tensorflow_cpp tensorflow::ops::IsNan tensorflow::ops::IsNan
======================
`#include <math_ops.h>`
Returns which elements of x are NaN.
Summary
-------
(numpy) Equivalent to np.isnan
Example:
```
x = tf.constant([5.0, np.nan, 6.8, np.nan, np.inf])
tf.math.is_nan(x) ==> [False, True, False, True, False]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The y tensor.
| Constructors and Destructors |
| --- |
| `[IsNan](#classtensorflow_1_1ops_1_1_is_nan_1a481e821b40227f16a650d37aa967db87)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_is_nan_1a8db1a8e17322eada84b8bbe2d233afa9)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[y](#classtensorflow_1_1ops_1_1_is_nan_1a22650199a7df3f97d66b2e02741bc77d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_is_nan_1a5b6065f1acd5d0467007cdf9c3eda10f)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_is_nan_1aa4342d04c881d6a9744bfdb036b8c646)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_is_nan_1a2b78c36ff0b31009b8b996fc62ad3b9f)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### y
```
::tensorflow::Output y
```
Public functions
----------------
### IsNan
```
IsNan(
const ::tensorflow::Scope & scope,
::tensorflow::Input x
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::Stack tensorflow::ops::Stack
======================
`#include <array_ops.h>`
Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor.
Summary
-------
Packs the `N` tensors in `values` into a tensor with rank one higher than each tensor in `values`, by packing them along the `axis` dimension. Given a list of tensors of shape `(A, B, C)`;
if `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`. if `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`. Etc.
For example:
```
# 'x' is [1, 4]
# 'y' is [2, 5]
# 'z' is [3, 6]
pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.
pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
```
This is the opposite of `unpack`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* values: Must be of same shape and type.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/stack/attrs#structtensorflow_1_1ops_1_1_stack_1_1_attrs)`):
* axis: Dimension along which to pack. Negative values wrap around, so the valid range is `[-(R+1), R+1)`.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The packed tensor.
| Constructors and Destructors |
| --- |
| `[Stack](#classtensorflow_1_1ops_1_1_stack_1aa3a6f6cc75aa0bc3e217610c4b630850)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values)` |
| `[Stack](#classtensorflow_1_1ops_1_1_stack_1af619225abec63de439cb9ade43b936a8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, const [Stack::Attrs](../../../struct/tensorflow/ops/stack/attrs#structtensorflow_1_1ops_1_1_stack_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_stack_1aa46830d4c02fef768a0142707c6048d7)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_stack_1af30b0181ca359975456c27dda4c0ce4e)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_stack_1a934f8ed07dd585da717a4a55f7ffec62)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_stack_1a17fdd11a1152984a35f55b52ff4753f8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_stack_1aa93a9c40ba77fc16a19e5b1320fea39c)() const` | |
| Public static functions |
| --- |
| `[Axis](#classtensorflow_1_1ops_1_1_stack_1a52044bc69e273453a899ab690fafc227)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/stack/attrs#structtensorflow_1_1ops_1_1_stack_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::Stack::Attrs](../../../struct/tensorflow/ops/stack/attrs) | Optional attribute setters for [Stack](stack#classtensorflow_1_1ops_1_1_stack). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Stack
```
Stack(
const ::tensorflow::Scope & scope,
::tensorflow::InputList values
)
```
### Stack
```
Stack(
const ::tensorflow::Scope & scope,
::tensorflow::InputList values,
const Stack::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### Axis
```
Attrs Axis(
int64 x
)
```
tensorflow_cpp tensorflow::ops::BatchToSpaceND tensorflow::ops::BatchToSpaceND
===============================
`#include <array_ops.h>`
[BatchToSpace](batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for N-D tensors of type T.
Summary
-------
This operation reshapes the "batch" dimension 0 into `M + 1` dimensions of shape `block_shape + [batch]`, interleaves these blocks back into the grid defined by the spatial dimensions `[1, ..., M]`, to obtain a result with the same rank as the input. The spatial dimensions of this intermediate result are then optionally cropped according to `crops` to produce the output. This is the reverse of SpaceToBatch. See below for a precise description.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* input: N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, where spatial\_shape has M dimensions.
* block\_shape: 1-D with shape `[M]`, all values must be >= 1.
* crops: 2-D with shape `[M, 2]`, all values must be >= 0. `crops[i] = [crop_start, crop_end]` specifies the amount to crop from input dimension `i + 1`, which corresponds to spatial dimension `i`. It is required that `crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]`.
This operation is equivalent to the following steps:
1. Reshape `input` to `reshaped` of shape: [block\_shape[0], ..., block\_shape[M-1], batch / prod(block\_shape), input\_shape[1], ..., input\_shape[N-1]]
2. Permute dimensions of `reshaped` to produce `permuted` of shape [batch / prod(block\_shape),input\_shape[1], block\_shape[0], ..., input\_shape[M], block\_shape[M-1],input\_shape[M+1], ..., input\_shape[N-1]]
3. Reshape `permuted` to produce `reshaped_permuted` of shape [batch / prod(block\_shape),input\_shape[1] \* block\_shape[0], ..., input\_shape[M] \* block\_shape[M-1],input\_shape[M+1], ..., input\_shape[N-1]]
4. Crop the start and end of dimensions `[1, ..., M]` of `reshaped_permuted` according to `crops` to produce the output of shape: [batch / prod(block\_shape),input\_shape[1] \* block\_shape[0] - crops[0,0] - crops[0,1], ..., input\_shape[M] \* block\_shape[M-1] - crops[M-1,0] - crops[M-1,1],input\_shape[M+1], ..., input\_shape[N-1]]
Some examples:
(1) For the following input of shape `[4, 1, 1, 1]`, `block_shape = [2, 2]`, and `crops = [[0, 0], [0, 0]]`:
```
[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
```
The output tensor has shape `[1, 2, 2, 1]` and value:
```
x = [[[[1], [2]], [[3], [4]]]]
```
(2) For the following input of shape `[4, 1, 1, 3]`, `block_shape = [2, 2]`, and `crops = [[0, 0], [0, 0]]`:
```
[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
```
The output tensor has shape `[1, 2, 2, 3]` and value:
```
x = [[[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]]]
```
(3) For the following input of shape `[4, 2, 2, 1]`, `block_shape = [2, 2]`, and `crops = [[0, 0], [0, 0]]`:
```
x = [[[[1], [3]], [[9], [11]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]]
```
The output tensor has shape `[1, 4, 4, 1]` and value:
```
x = [[[[1], [2], [3], [4]],
[[5], [6], [7], [8]],
[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]]
```
(4) For the following input of shape `[8, 1, 3, 1]`, `block_shape = [2, 2]`, and `crops = [[0, 0], [2, 0]]`:
```
x = [[[[0], [1], [3]]], [[[0], [9], [11]]],
[[[0], [2], [4]]], [[[0], [10], [12]]],
[[[0], [5], [7]]], [[[0], [13], [15]]],
[[[0], [6], [8]]], [[[0], [14], [16]]]]
```
The output tensor has shape `[2, 2, 4, 1]` and value:
```
x = [[[[1], [2], [3], [4]],
[[5], [6], [7], [8]]],
[[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]]
```
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[BatchToSpaceND](#classtensorflow_1_1ops_1_1_batch_to_space_n_d_1ae9fc7cf839b67ec1692eb9dbd13dab3f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) block_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) crops)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_batch_to_space_n_d_1a1e8d19aed27a8ba75041200ee25a7310)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_batch_to_space_n_d_1a2f9a5258c2d37ba9ce71c6ebfe2f754d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_batch_to_space_n_d_1a8c320b154abac62302b289161e5aa745)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_batch_to_space_n_d_1a94adde19cfddf4d1109cceff401543c8)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_batch_to_space_n_d_1a17e07f190557e6565111355cc159b528)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BatchToSpaceND
```
BatchToSpaceND(
const ::tensorflow::Scope & scope,
::tensorflow::Input input,
::tensorflow::Input block_shape,
::tensorflow::Input crops
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::SparseDenseCwiseAdd tensorflow::ops::SparseDenseCwiseAdd
====================================
`#include <sparse_ops.h>`
Adds up a SparseTensor and a dense [Tensor](../tensor#classtensorflow_1_1_tensor), using these special rules:
Summary
-------
(1) Broadcasts the dense side to have the same shape as the sparse side, if eligible; (2) Then, only the dense values pointed to by the indices of the SparseTensor participate in the cwise addition.
By these rules, the result is a logical SparseTensor with exactly the same indices and shape, but possibly with different non-zero values. The output of this Op is the resultant non-zero values.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* sp\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.
* sp\_values: 1-D. `N` non-empty values corresponding to `sp_indices`.
* sp\_shape: 1-D. Shape of the input SparseTensor.
* dense: `R`-D. The dense [Tensor](../tensor#classtensorflow_1_1_tensor) operand.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: 1-D. The `N` values that are operated on.
| Constructors and Destructors |
| --- |
| `[SparseDenseCwiseAdd](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a40c54ec3d21552370675a287e1998c0f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) sp_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dense)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a72eb8f04e1ba3079957c50afaaa13e79)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1afe9875882370618c9e8b76e5d1dccb26)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a4e49f5451389b499b3f51dfeb39146b6)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1ac05df51f21a0dc708e8ab33c853e5d6c)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1af0582cc0d8c6d71b9de9e50358f27392)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### SparseDenseCwiseAdd
```
SparseDenseCwiseAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input sp_indices,
::tensorflow::Input sp_values,
::tensorflow::Input sp_shape,
::tensorflow::Input dense
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::Xdivy tensorflow::ops::Xdivy
======================
`#include <math_ops.h>`
Returns 0 if x == 0, and x / y otherwise, elementwise.
Summary
-------
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The z tensor.
| Constructors and Destructors |
| --- |
| `[Xdivy](#classtensorflow_1_1ops_1_1_xdivy_1ad26fd4b1c548513642f406572fce0507)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_xdivy_1ae9d770c1a11ebc2a4a198508f265061a)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[z](#classtensorflow_1_1ops_1_1_xdivy_1a4645829f1bb827174dca0041356ac129)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_xdivy_1aa61033b7571d45bd6ff7d2528c73215c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_xdivy_1a0e6a52fb55e2261db109d6b3eb16f05f)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_xdivy_1a936736969b8b301acf4adf6f9129107d)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### z
```
::tensorflow::Output z
```
Public functions
----------------
### Xdivy
```
Xdivy(
const ::tensorflow::Scope & scope,
::tensorflow::Input x,
::tensorflow::Input y
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
tensorflow_cpp tensorflow::ops::AvgPool tensorflow::ops::AvgPool
========================
`#include <nn_ops.h>`
Performs average pooling on the input.
Summary
-------
Each entry in `output` is the mean of the corresponding size `ksize` window in `value`.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* value: 4-D with shape `[batch, height, width, channels]`.
* ksize: The size of the sliding window for each dimension of `value`.
* strides: The stride of the sliding window for each dimension of `value`.
* padding: The type of padding algorithm to use.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/avg-pool/attrs#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width].
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The average pooled output tensor.
| Constructors and Destructors |
| --- |
| `[AvgPool](#classtensorflow_1_1ops_1_1_avg_pool_1a58bd5cc7bc50a385d9b5407b567887f3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` |
| `[AvgPool](#classtensorflow_1_1ops_1_1_avg_pool_1a0f24ed27c87f4865fcaa1b312d36051e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [AvgPool::Attrs](../../../struct/tensorflow/ops/avg-pool/attrs#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_avg_pool_1a9ba893843bb88eb584fe939ccc894c47)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_avg_pool_1a7450e2619257f7964d4f2cd80fe4ef06)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_avg_pool_1a8ec01e53d8d2acab543c9012e451de71)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_avg_pool_1a4e2e1ea74f43b355dca513d2bfe8d0a0)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_avg_pool_1ad407c5a3d99897fdc14d133bac7172d0)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_avg_pool_1a4295525a4e3759a16de6a93c7f421b8d)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/avg-pool/attrs#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::AvgPool::Attrs](../../../struct/tensorflow/ops/avg-pool/attrs) | Optional attribute setters for [AvgPool](avg-pool#classtensorflow_1_1ops_1_1_avg_pool). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### AvgPool
```
AvgPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding
)
```
### AvgPool
```
AvgPool(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
const gtl::ArraySlice< int > & ksize,
const gtl::ArraySlice< int > & strides,
StringPiece padding,
const AvgPool::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::Conj tensorflow::ops::Conj
=====================
`#include <math_ops.h>`
Returns the complex conjugate of a complex number.
Summary
-------
Given a tensor `input` of complex numbers, this operation returns a tensor of complex numbers that are the complex conjugate of each element in `input`. The complex numbers in `input` must be of the form \(a + bj\), where *a* is the real part and *b* is the imaginary part.
The complex conjugate returned by this operation is of the form \(a - bj\).
For example:
```
# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
tf.conj(input) ==> [-2.25 - 4.75j, 3.25 - 5.75j]
```
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[Conj](#classtensorflow_1_1ops_1_1_conj_1a8f7233511e2a1a69f87257562f793389)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_conj_1a5fefdf385bc3d436389114cdc0a9f9ba)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_conj_1aea384c3c77a5918f2d31b72ad64a155a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_conj_1ac0a0d5db60f5731bf0fd10e22a70590c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conj_1a66307fa4c196df6a9506388209ade118)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conj_1a6e6e95ae739308bad32d899ec224f213)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### Conj
```
Conj(
const ::tensorflow::Scope & scope,
::tensorflow::Input input
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
| programming_docs |
tensorflow_cpp tensorflow::ops::BiasAdd tensorflow::ops::BiasAdd
========================
`#include <nn_ops.h>`
Adds `bias` to `value`.
Summary
-------
This is a special case of `tf.add` where `bias` is restricted to be 1-D. Broadcasting is supported, so `value` may have any number of dimensions.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* value: [Any](any#classtensorflow_1_1ops_1_1_any) number of dimensions.
* bias: 1-D with size the last dimension of `value`.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/bias-add/attrs#structtensorflow_1_1ops_1_1_bias_add_1_1_attrs)`):
* data\_format: Specify the data format of the input and output data. With the default format "NHWC", the bias tensor will be added to the last dimension of the value tensor. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. The tensor will be added to "in\_channels", the third-to-the-last dimension.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Broadcasted sum of `value` and `bias`.
| Constructors and Destructors |
| --- |
| `[BiasAdd](#classtensorflow_1_1ops_1_1_bias_add_1a557f3731192ba1a1281f5e93feda8b09)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bias)` |
| `[BiasAdd](#classtensorflow_1_1ops_1_1_bias_add_1a59db6709f414edec0beb3a52ea21a4ba)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value, ::[tensorflow::Input](../input#classtensorflow_1_1_input) bias, const [BiasAdd::Attrs](../../../struct/tensorflow/ops/bias-add/attrs#structtensorflow_1_1ops_1_1_bias_add_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_bias_add_1a4745da3d9a9423c0ddb653a80ba0b81e)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_bias_add_1a8894dda0cc6b6456db95a303256ccf38)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_bias_add_1a0be2c046b83f6a0710802e14a772e392)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bias_add_1a8e189ec658d703610e8f20b60eae0498)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bias_add_1af1515b8af002cafdd40ef73b44794553)() const` | |
| Public static functions |
| --- |
| `[DataFormat](#classtensorflow_1_1ops_1_1_bias_add_1a48906c6a8a955f34d82526187493f433)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/bias-add/attrs#structtensorflow_1_1ops_1_1_bias_add_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::BiasAdd::Attrs](../../../struct/tensorflow/ops/bias-add/attrs) | Optional attribute setters for [BiasAdd](bias-add#classtensorflow_1_1ops_1_1_bias_add). |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### BiasAdd
```
BiasAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
::tensorflow::Input bias
)
```
### BiasAdd
```
BiasAdd(
const ::tensorflow::Scope & scope,
::tensorflow::Input value,
::tensorflow::Input bias,
const BiasAdd::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### DataFormat
```
Attrs DataFormat(
StringPiece x
)
```
tensorflow_cpp tensorflow::ops::SparseApplyProximalAdagrad tensorflow::ops::SparseApplyProximalAdagrad
===========================================
`#include <training_ops.h>`
Sparse update entries in '\*var' and '\*accum' according to FOBOS algorithm.
Summary
-------
That is for rows we have grad for, we update var and accum as follows: $$accum += grad \* grad$$ $$prox\_v = var$$ $$prox\_v -= lr \* grad \* (1 / sqrt(accum))$$ $$var = sign(prox\_v)/(1+lr\*l2) \* max{|prox\_v|-lr\*l1,0}$$
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
* var: Should be from a Variable().
* accum: Should be from a Variable().
* lr: Learning rate. Must be a scalar.
* l1: L1 regularization. Must be a scalar.
* l2: L2 regularization. Must be a scalar.
* grad: The gradient.
* indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1_1_attrs)`):
* use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: Same as "var".
| Constructors and Destructors |
| --- |
| `[SparseApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a21fa09e8bdc18bd3af898fc1bac2db7c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` |
| `[SparseApplyProximalAdagrad](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a4fc83cfe61291fd343af1715a113991f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [SparseApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1_1_attrs) & attrs)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a5ed248aabc3f2e57bb2ec02474bae5eb)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[out](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1ae76daa049da9c6791c3d1138600e1183)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a0829699482ccdeaea83ed72824dca938)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a2eeecd8c1fe64b3647d9270491c25614)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a9c08fcd6cb0c47ffe0874f93e55c7b70)() const` | |
| Public static functions |
| --- |
| `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1a29609264681993d95d92afd7eb69e3b2)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-adagrad/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1_1_attrs)` |
| Structs |
| --- |
| [tensorflow::ops::SparseApplyProximalAdagrad::Attrs](../../../struct/tensorflow/ops/sparse-apply-proximal-adagrad/attrs) | Optional attribute setters for [SparseApplyProximalAdagrad](sparse-apply-proximal-adagrad#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad). |
Public attributes
-----------------
### operation
```
Operation operation
```
### out
```
::tensorflow::Output out
```
Public functions
----------------
### SparseApplyProximalAdagrad
```
SparseApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices
)
```
### SparseApplyProximalAdagrad
```
SparseApplyProximalAdagrad(
const ::tensorflow::Scope & scope,
::tensorflow::Input var,
::tensorflow::Input accum,
::tensorflow::Input lr,
::tensorflow::Input l1,
::tensorflow::Input l2,
::tensorflow::Input grad,
::tensorflow::Input indices,
const SparseApplyProximalAdagrad::Attrs & attrs
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
Public static functions
-----------------------
### UseLocking
```
Attrs UseLocking(
bool x
)
```
tensorflow_cpp tensorflow::ops::NextAfter tensorflow::ops::NextAfter
==========================
`#include <math_ops.h>`
Returns the next representable value of `x1` in the direction of `x2`, element-wise.
Summary
-------
This operation returns the same result as the C++ std::nextafter function.
It can also return a subnormal number.
(cpp) Equivalent to C++ std::nextafter function.
Args:
* scope: A [Scope](../scope#classtensorflow_1_1_scope) object
Returns:
* `[Output](../output#classtensorflow_1_1_output)`: The output tensor.
| Constructors and Destructors |
| --- |
| `[NextAfter](#classtensorflow_1_1ops_1_1_next_after_1ae1a04ef0a54ffad640ba9cc864513073)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x2)` |
| Public attributes |
| --- |
| `[operation](#classtensorflow_1_1ops_1_1_next_after_1ae4bb641dd38cad4e78398547d90e0f29)` | `[Operation](../operation#classtensorflow_1_1_operation)` |
| `[output](#classtensorflow_1_1ops_1_1_next_after_1a30e79b8af5bd55d4aac789d0bde4fdb7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` |
| Public functions |
| --- |
| `[node](#classtensorflow_1_1ops_1_1_next_after_1a42a793f8d95774b563203564d85a2b5c)() const` | `::tensorflow::Node *` |
| `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_next_after_1a2830a8a855e467d13590df308cee7372)() const` | |
| `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_next_after_1a50c81e91846ea93ff4174b5d2d4a3b26)() const` | |
Public attributes
-----------------
### operation
```
Operation operation
```
### output
```
::tensorflow::Output output
```
Public functions
----------------
### NextAfter
```
NextAfter(
const ::tensorflow::Scope & scope,
::tensorflow::Input x1,
::tensorflow::Input x2
)
```
### node
```
::tensorflow::Node * node() const
```
### operator::tensorflow::Input
```
operator::tensorflow::Input() const
```
### operator::tensorflow::Output
```
operator::tensorflow::Output() const
```
svelte Svelte Svelte
======
Before we begin
---------------
This page contains detailed API reference documentation. It's intended to be a resource for people who already have some familiarity with Svelte.
If that's not you (yet), you may prefer to visit the [interactive tutorial](https://svelte.dev/tutorial) or the [examples](https://svelte.dev/examples) before consulting this reference.
Don't be shy about asking for help in the [Discord chatroom](https://svelte.dev/chat).
Using an older version of Svelte? Have a look at the [v2 docs](https://v2.svelte.dev).
Getting started
---------------
To try Svelte in an interactive online environment you can try [the REPL](https://svelte.dev/repl) or [StackBlitz](https://node.new/svelte).
To create a project locally we recommend using [SvelteKit](https://kit.svelte.dev/), the official application framework from the Svelte team:
```
npm create svelte@latest myapp
cd myapp
npm install
npm run dev
```
SvelteKit will handle calling [the Svelte compiler](https://www.npmjs.com/package/svelte) to convert your `.svelte` files into `.js` files that create the DOM and `.css` files that style it. It also provides all the other pieces you need to build a web application such as a development server, routing, and deployment. [SvelteKit](https://kit.svelte.dev/) utilizes [Vite](https://vitejs.dev/) to build your code and handle server-side rendering (SSR). There are [plugins for all the major web bundlers](https://sveltesociety.dev/tools#bundling) to handle Svelte compilation, which will output `.js` and `.css` that you can insert into your HTML, but most others won't handle SSR.
If you don't need a full-fledged app framework and instead want to build a simple frontend-only site/app, you can also use Svelte (without Kit) with Vite by running `npm init vite` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS and CSS files inside the `dist` directory.
The Svelte team maintains a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) and there are integrations with various other [editors](https://sveltesociety.dev/tools#editor-support) and tools as well.
If you're having trouble, get help on [Discord](https://svelte.dev/chat) or [StackOverflow](https://stackoverflow.com/questions/tagged/svelte).
Component format
----------------
Components are the building blocks of Svelte applications. They are written into `.svelte` files, using a superset of HTML.
All three sections — script, styles and markup — are optional.
```
<script>
// logic goes here
</script>
<!-- markup (zero or more items) goes here -->
<style>
/\* styles go here \*/
</style>
```
### <script>
A `<script>` block contains JavaScript that runs when a component instance is created. Variables declared (or imported) at the top level are 'visible' from the component's markup. There are four additional rules:
#### 1. `export` creates a component prop
Svelte uses the `export` keyword to mark a variable declaration as a *property* or *prop*, which means it becomes accessible to consumers of the component (see the section on [attributes and props](../docs#template-syntax-attributes-and-props) for more information).
```
<script>
export let foo;
// Values that are passed in as props
// are immediately available
console.log({ foo });
</script>
```
You can specify a default initial value for a prop. It will be used if the component's consumer doesn't specify the prop on the component (or if its initial value is `undefined`) when instantiating the component. Note that whenever a prop is removed by the consumer, its value is set to `undefined` rather than the initial value.
In development mode (see the [compiler options](../docs#compile-time-svelte-compile)), a warning will be printed if no default initial value is provided and the consumer does not specify a value. To squelch this warning, ensure that a default initial value is specified, even if it is `undefined`.
```
<script>
export let bar = 'optional default initial value';
export let baz = undefined;
</script>
```
If you export a `const`, `class` or `function`, it is readonly from outside the component. Functions are valid prop values, however, as shown below.
```
<script>
// these are readonly
export const thisIs = 'readonly';
export function greet(name) {
alert(`hello ${name}!`);
}
// this is a prop
export let format = n => n.toFixed(2);
</script>
```
Readonly props can be accessed as properties on the element, tied to the component using [`bind:this` syntax](../docs#template-syntax-component-directives-bind-this).
You can use reserved words as prop names.
```
<script>
let className;
// creates a `class` property, even
// though it is a reserved word
export { className as class };
</script>
```
#### 2. Assignments are 'reactive'
To change component state and trigger a re-render, just assign to a locally declared variable.
Update expressions (`count += 1`) and property assignments (`obj.x = y`) have the same effect.
```
<script>
let count = 0;
function handleClick () {
// calling this function will trigger an
// update if the markup references `count`
count = count + 1;
}
</script>
```
Because Svelte's reactivity is based on assignments, using array methods like `.push()` and `.splice()` won't automatically trigger updates. A subsequent assignment is required to trigger the update. This and more details can also be found in the [tutorial](https://svelte.dev/tutorial/updating-arrays-and-objects).
```
<script>
let arr = [0, 1];
function handleClick () {
// this method call does not trigger an update
arr.push(2);
// this assignment will trigger an update
// if the markup references `arr`
arr = arr
}
</script>
```
Svelte's `<script>` blocks are run only when the component is created, so assignments within a `<script>` block are not automatically run again when a prop updates. If you'd like to track changes to a prop, see the next example in the following section.
```
<script>
export let person;
// this will only set `name` on component creation
// it will not update when `person` does
let { name } = person;
</script>
```
#### 3. `$:` marks a statement as reactive
Any top-level statement (i.e. not inside a block or a function) can be made reactive by prefixing it with the `$:` [JS label syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label). Reactive statements run after other script code and before the component markup is rendered, whenever the values that they depend on have changed.
```
<script>
export let title;
export let person
// this will update `document.title` whenever
// the `title` prop changes
$: document.title = title;
$: {
console.log(`multiple statements can be combined`);
console.log(`the current title is ${title}`);
}
// this will update `name` when 'person' changes
$: ({ name } = person);
// don't do this. it will run before the previous line
let name2 = name;
</script>
```
Only values which directly appear within the `$:` block will become dependencies of the reactive statement. For example, in the code below `total` will only update when `x` changes, but not `y`.
```
<script>
let x = 0;
let y = 0;
function yPlusAValue(value) {
return value + y;
}
$: total = yPlusAValue(x);
</script>
Total: {total}
<button on:click={() => x++}>
Increment X
</button>
<button on:click={() => y++}>
Increment Y
</button>
```
It is important to note that the reactive blocks are ordered via simple static analysis at compile time, and all the compiler looks at are the variables that are assigned to and used within the block itself, not in any functions called by them. This means that `yDependent` will not be updated when `x` is updated in the following example:
```
<script>
let x = 0;
let y = 0;
const setY = (value) => {
y = value;
}
$: yDependent = y;
$: setY(x);
</script>
```
Moving the line `$: yDependent = y` below `$: setY(x)` will cause `yDependent` to be updated when `x` is updated.
If a statement consists entirely of an assignment to an undeclared variable, Svelte will inject a `let` declaration on your behalf.
```
<script>
export let num;
// we don't need to declare `squared` and `cubed`
// — Svelte does it for us
$: squared = num \* num;
$: cubed = squared \* num;
</script>
```
#### 4. Prefix stores with `$` to access their values
A *store* is an object that allows reactive access to a value via a simple *store contract*. The [`svelte/store` module](../docs#run-time-svelte-store) contains minimal store implementations which fulfil this contract.
Any time you have a reference to a store, you can access its value inside a component by prefixing it with the `$` character. This causes Svelte to declare the prefixed variable, subscribe to the store at component initialization and unsubscribe when appropriate.
Assignments to `$`-prefixed variables require that the variable be a writable store, and will result in a call to the store's `.set` method.
Note that the store must be declared at the top level of the component — not inside an `if` block or a function, for example.
Local variables (that do not represent store values) must *not* have a `$` prefix.
```
<script>
import { writable } from 'svelte/store';
const count = writable(0);
console.log($count); // logs 0
count.set(1);
console.log($count); // logs 1
$count = 2;
console.log($count); // logs 2
</script>
```
##### Store contract
```
store = { subscribe: (subscription: (value: any) => void) => (() => void), set?: (value: any) => void }
```
You can create your own stores without relying on [`svelte/store`](../docs#run-time-svelte-store), by implementing the *store contract*:
1. A store must contain a `.subscribe` method, which must accept as its argument a subscription function. This subscription function must be immediately and synchronously called with the store's current value upon calling `.subscribe`. All of a store's active subscription functions must later be synchronously called whenever the store's value changes.
2. The `.subscribe` method must return an unsubscribe function. Calling an unsubscribe function must stop its subscription, and its corresponding subscription function must not be called again by the store.
3. A store may *optionally* contain a `.set` method, which must accept as its argument a new value for the store, and which synchronously calls all of the store's active subscription functions. Such a store is called a *writable store*.
For interoperability with RxJS Observables, the `.subscribe` method is also allowed to return an object with an `.unsubscribe` method, rather than return the unsubscription function directly. Note however that unless `.subscribe` synchronously calls the subscription (which is not required by the Observable spec), Svelte will see the value of the store as `undefined` until it does.
### <script context="module">
A `<script>` tag with a `context="module"` attribute runs once when the module first evaluates, rather than for each component instance. Values declared in this block are accessible from a regular `<script>` (and the component markup) but not vice versa.
You can `export` bindings from this block, and they will become exports of the compiled module.
You cannot `export default`, since the default export is the component itself.
> Variables defined in `module` scripts are not reactive — reassigning them will not trigger a rerender even though the variable itself will update. For values shared between multiple components, consider using a [store](../docs#run-time-svelte-store).
>
>
```
<script context="module">
let totalComponents = 0;
// this allows an importer to do e.g.
// `import Example, { alertTotal } from './Example.svelte'`
export function alertTotal() {
alert(totalComponents);
}
</script>
<script>
totalComponents += 1;
console.log(`total number of times this component has been created: ${totalComponents}`);
</script>
```
### <style>
CSS inside a `<style>` block will be scoped to that component.
This works by adding a class to affected elements, which is based on a hash of the component styles (e.g. `svelte-123xyz`).
```
<style>
p {
/\* this will only affect <p> elements in this component \*/
color: burlywood;
}
</style>
```
To apply styles to a selector globally, use the `:global(...)` modifier.
```
<style>
:global(body) {
/\* this will apply to <body> \*/
margin: 0;
}
div :global(strong) {
/\* this will apply to all <strong> elements, in any
component, that are inside <div> elements belonging
to this component \*/
color: goldenrod;
}
p:global(.red) {
/\* this will apply to all <p> elements belonging to this
component with a class of red, even if class="red" does
not initially appear in the markup, and is instead
added at runtime. This is useful when the class
of the element is dynamically applied, for instance
when updating the element's classList property directly. \*/
}
</style>
```
If you want to make @keyframes that are accessible globally, you need to prepend your keyframe names with `-global-`.
The `-global-` part will be removed when compiled, and the keyframe then be referenced using just `my-animation-name` elsewhere in your code.
```
<style>
@keyframes -global-my-animation-name {...}
</style>
```
There should only be 1 top-level `<style>` tag per component.
However, it is possible to have `<style>` tag nested inside other elements or logic blocks.
In that case, the `<style>` tag will be inserted as-is into the DOM, no scoping or processing will be done on the `<style>` tag.
```
<div>
<style>
/\* this style tag will be inserted as-is \*/
div {
/\* this will apply to all `<div>` elements in the DOM \*/
color: red;
}
</style>
</div>
```
Template syntax
---------------
### Tags
A lowercase tag, like `<div>`, denotes a regular HTML element. A capitalised tag, such as `<Widget>` or `<Namespace.Widget>`, indicates a *component*.
```
<script>
import Widget from './Widget.svelte';
</script>
<div>
<Widget/>
</div>
```
### Attributes and props
By default, attributes work exactly like their HTML counterparts.
```
<div class="foo">
<button disabled>can't touch this</button>
</div>
```
As in HTML, values may be unquoted.
```
<input type=checkbox>
```
Attribute values can contain JavaScript expressions.
```
<a href="page/{p}">page {p}</a>
```
Or they can *be* JavaScript expressions.
```
<button disabled={!clickable}>...</button>
```
Boolean attributes are included on the element if their value is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) and excluded if it's [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy).
All other attributes are included unless their value is [nullish](https://developer.mozilla.org/en-US/docs/Glossary/Nullish) (`null` or `undefined`).
```
<input required={false} placeholder="This input field is not required">
<div title={null}>This div has no title attribute</div>
```
An expression might include characters that would cause syntax highlighting to fail in regular HTML, so quoting the value is permitted. The quotes do not affect how the value is parsed:
```
<button disabled="{number !== 42}">...</button>
```
When the attribute name and value match (`name={name}`), they can be replaced with `{name}`.
```
<!-- These are equivalent -->
<button disabled={disabled}>...</button>
<button {disabled}>...</button>
```
By convention, values passed to components are referred to as *properties* or *props* rather than *attributes*, which are a feature of the DOM.
As with elements, `name={name}` can be replaced with the `{name}` shorthand.
```
<Widget foo={bar} answer={42} text="hello"/>
```
*Spread attributes* allow many attributes or properties to be passed to an element or component at once.
An element or component can have multiple spread attributes, interspersed with regular ones.
```
<Widget {...things}/>
```
*`$$props`* references all props that are passed to a component, including ones that are not declared with `export`. It is not generally recommended, as it is difficult for Svelte to optimise. But it can be useful in rare cases – for example, when you don't know at compile time what props might be passed to a component.
```
<Widget {...$$props}/>
```
*`$$restProps`* contains only the props which are *not* declared with `export`. It can be used to pass down other unknown attributes to an element in a component. It shares the same optimisation problems as *`$$props`*, and is likewise not recommended.
```
<input {...$$restProps}>
```
> The `value` attribute of an `input` element or its children `option` elements must not be set with spread attributes when using `bind:group` or `bind:checked`. Svelte needs to be able to see the element's `value` directly in the markup in these cases so that it can link it to the bound variable.
>
>
> Sometimes, the attribute order matters as Svelte sets attributes sequentially in JavaScript. For example, `<input type="range" min="0" max="1" value={0.5} step="0.1"/>`, Svelte will attempt to set the value to `1` (rounding up from 0.5 as the step by default is 1), and then set the step to `0.1`. To fix this, change it to `<input type="range" min="0" max="1" step="0.1" value={0.5}/>`.
>
>
> Another example is `<img src="..." loading="lazy" />`. Svelte will set the img `src` before making the img element `loading="lazy"`, which is probably too late. Change this to `<img loading="lazy" src="...">` to make the image lazily loaded.
>
>
### Text expressions
```
{expression}
```
Text can also contain JavaScript expressions:
> If you're using a regular expression (`RegExp`) [literal notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#literal_notation_and_constructor), you'll need to wrap it in parentheses.
>
>
```
<h1>Hello {name}!</h1>
<p>{a} + {b} = {a + b}.</p>
<div>{(/^[A-Za-z ]+$/).test(value) ? x : y}</div>
```
### Comments
You can use HTML comments inside components.
```
<!-- this is a comment! -->
<h1>Hello world</h1>
```
Comments beginning with `svelte-ignore` disable warnings for the next block of markup. Usually, these are accessibility warnings; make sure that you're disabling them for a good reason.
```
<!-- svelte-ignore a11y-autofocus -->
<input bind:value={name} autofocus>
```
### {#if ...}
```
{#if expression}...{/if}
```
```
{#if expression}...{:else if expression}...{/if}
```
```
{#if expression}...{:else}...{/if}
```
Content that is conditionally rendered can be wrapped in an if block.
```
{#if answer === 42}
<p>what was the question?</p>
{/if}
```
Additional conditions can be added with `{:else if expression}`, optionally ending in an `{:else}` clause.
```
{#if porridge.temperature > 100}
<p>too hot!</p>
{:else if 80 > porridge.temperature}
<p>too cold!</p>
{:else}
<p>just right!</p>
{/if}
```
### {#each ...}
```
{#each expression as name}...{/each}
```
```
{#each expression as name, index}...{/each}
```
```
{#each expression as name (key)}...{/each}
```
```
{#each expression as name, index (key)}...{/each}
```
```
{#each expression as name}...{:else}...{/each}
```
Iterating over lists of values can be done with an each block.
```
<h1>Shopping list</h1>
<ul>
{#each items as item}
<li>{item.name} x {item.qty}</li>
{/each}
</ul>
```
You can use each blocks to iterate over any array or array-like value — that is, any object with a `length` property.
An each block can also specify an *index*, equivalent to the second argument in an `array.map(...)` callback:
```
{#each items as item, i}
<li>{i + 1}: {item.name} x {item.qty}</li>
{/each}
```
If a *key* expression is provided — which must uniquely identify each list item — Svelte will use it to diff the list when data changes, rather than adding or removing items at the end. The key can be any object, but strings and numbers are recommended since they allow identity to persist when the objects themselves change.
```
{#each items as item (item.id)}
<li>{item.name} x {item.qty}</li>
{/each}
<!-- or with additional index value -->
{#each items as item, i (item.id)}
<li>{i + 1}: {item.name} x {item.qty}</li>
{/each}
```
You can freely use destructuring and rest patterns in each blocks.
```
{#each items as { id, name, qty }, i (id)}
<li>{i + 1}: {name} x {qty}</li>
{/each}
{#each objects as { id, ...rest }}
<li><span>{id}</span><MyComponent {...rest}/></li>
{/each}
{#each items as [id, ...rest]}
<li><span>{id}</span><MyComponent values={rest}/></li>
{/each}
```
An each block can also have an `{:else}` clause, which is rendered if the list is empty.
```
{#each todos as todo}
<p>{todo.text}</p>
{:else}
<p>No tasks today!</p>
{/each}
```
### {#await ...}
```
{#await expression}...{:then name}...{:catch name}...{/await}
```
```
{#await expression}...{:then name}...{/await}
```
```
{#await expression then name}...{/await}
```
```
{#await expression catch name}...{/await}
```
Await blocks allow you to branch on the three possible states of a Promise — pending, fulfilled or rejected. In SSR mode, only the pending state will be rendered on the server.
```
{#await promise}
<!-- promise is pending -->
<p>waiting for the promise to resolve...</p>
{:then value}
<!-- promise was fulfilled -->
<p>The value is {value}</p>
{:catch error}
<!-- promise was rejected -->
<p>Something went wrong: {error.message}</p>
{/await}
```
The `catch` block can be omitted if you don't need to render anything when the promise rejects (or no error is possible).
```
{#await promise}
<!-- promise is pending -->
<p>waiting for the promise to resolve...</p>
{:then value}
<!-- promise was fulfilled -->
<p>The value is {value}</p>
{/await}
```
If you don't care about the pending state, you can also omit the initial block.
```
{#await promise then value}
<p>The value is {value}</p>
{/await}
```
Similarly, if you only want to show the error state, you can omit the `then` block.
```
{#await promise catch error}
<p>The error is {error}</p>
{/await}
```
### {#key ...}
```
{#key expression}...{/key}
```
Key blocks destroy and recreate their contents when the value of an expression changes.
This is useful if you want an element to play its transition whenever a value changes.
```
{#key value}
<div transition:fade>{value}</div>
{/key}
```
When used around components, this will cause them to be reinstantiated and reinitialised.
```
{#key value}
<Component />
{/key}
```
### {@html ...}
```
{@html expression}
```
In a text expression, characters like `<` and `>` are escaped; however, with HTML expressions, they're not.
The expression should be valid standalone HTML — `{@html "<div>"}content{@html "</div>"}` will *not* work, because `</div>` is not valid HTML. It also will *not* compile Svelte code.
> Svelte does not sanitize expressions before injecting HTML. If the data comes from an untrusted source, you must sanitize it, or you are exposing your users to an XSS vulnerability.
>
>
```
<div class="blog-post">
<h1>{post.title}</h1>
{@html post.content}
</div>
```
### {@debug ...}
```
{@debug}
```
```
{@debug var1, var2, ..., varN}
```
The `{@debug ...}` tag offers an alternative to `console.log(...)`. It logs the values of specific variables whenever they change, and pauses code execution if you have devtools open.
```
<script>
let user = {
firstname: 'Ada',
lastname: 'Lovelace'
};
</script>
{@debug user}
<h1>Hello {user.firstname}!</h1>
```
`{@debug ...}` accepts a comma-separated list of variable names (not arbitrary expressions).
```
<!-- Compiles -->
{@debug user}
{@debug user1, user2, user3}
<!-- WON'T compile -->
{@debug user.firstname}
{@debug myArray[0]}
{@debug !isReady}
{@debug typeof user === 'object'}
```
The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables.
### {@const ...}
```
{@const assignment}
```
The `{@const ...}` tag defines a local constant.
```
<script>
export let boxes;
</script>
{#each boxes as box}
{@const area = box.width \* box.height}
{box.width} * {box.height} = {area}
{/each}
```
`{@const}` is only allowed as direct child of `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<Component />` or `<svelte:fragment />`.
### Element directives
As well as attributes, elements can have *directives*, which control the element's behaviour in some way.
#### on:*eventname*
```
on:eventname={handler}
```
```
on:eventname|modifiers={handler}
```
Use the `on:` directive to listen to DOM events.
```
<script>
let count = 0;
function handleClick(event) {
count += 1;
}
</script>
<button on:click={handleClick}>
count: {count}
</button>
```
Handlers can be declared inline with no performance penalty. As with attributes, directive values may be quoted for the sake of syntax highlighters.
```
<button on:click="{() => count += 1}">
count: {count}
</button>
```
Add *modifiers* to DOM events with the `|` character.
```
<form on:submit|preventDefault={handleSubmit}>
<!-- the `submit` event's default is prevented,
so the page won't reload -->
</form>
```
The following modifiers are available:
* `preventDefault` — calls `event.preventDefault()` before running the handler
* `stopPropagation` — calls `event.stopPropagation()`, preventing the event reaching the next element
* `passive` — improves scrolling performance on touch/wheel events (Svelte will add it automatically where it's safe to do so)
* `nonpassive` — explicitly set `passive: false`
* `capture` — fires the handler during the *capture* phase instead of the *bubbling* phase
* `once` — remove the handler after the first time it runs
* `self` — only trigger handler if `event.target` is the element itself
* `trusted` — only trigger handler if `event.isTrusted` is `true`. I.e. if the event is triggered by a user action.
Modifiers can be chained together, e.g. `on:click|once|capture={...}`.
If the `on:` directive is used without a value, the component will *forward* the event, meaning that a consumer of the component can listen for it.
```
<button on:click>
The component itself will emit the click event
</button>
```
It's possible to have multiple event listeners for the same event:
```
<script>
let counter = 0;
function increment() {
counter = counter + 1;
}
function track(event) {
trackEvent(event)
}
</script>
<button on:click={increment} on:click={track}>Click me!</button>
```
#### bind:*property*
```
bind:property={variable}
```
Data ordinarily flows down, from parent to child. The `bind:` directive allows data to flow the other way, from child to parent. Most bindings are specific to particular elements.
The simplest bindings reflect the value of a property, such as `input.value`.
```
<input bind:value={name}>
<textarea bind:value={text}></textarea>
<input type="checkbox" bind:checked={yes}>
```
If the name matches the value, you can use shorthand.
```
<!-- These are equivalent -->
<input bind:value={value}>
<input bind:value>
```
Numeric input values are coerced; even though `input.value` is a string as far as the DOM is concerned, Svelte will treat it as a number. If the input is empty or invalid (in the case of `type="number"`), the value is `undefined`.
```
<input type="number" bind:value={num}>
<input type="range" bind:value={num}>
```
On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`FileList` of selected files](https://developer.mozilla.org/en-US/docs/Web/API/FileList). It is readonly.
```
<label for="avatar">Upload a picture:</label>
<input
accept="image/png, image/jpeg"
bind:files
id="avatar"
name="avatar"
type="file"
/>
```
If you're using `bind:` directives together with `on:` directives, the order that they're defined in affects the value of the bound variable when the event handler is called.
```
<script>
let value = 'Hello World';
</script>
<input
on:input="{() => console.log('Old value:', value)}"
bind:value
on:input="{() => console.log('New value:', value)}"
/>
```
Here we were binding to the value of a text input, which uses the `input` event. Bindings on other elements may use different events such as `change`.
##### Binding `<select>` value
A `<select>` value binding corresponds to the `value` property on the selected `<option>`, which can be any value (not just strings, as is normally the case in the DOM).
```
<select bind:value={selected}>
<option value={a}>a</option>
<option value={b}>b</option>
<option value={c}>c</option>
</select>
```
A `<select multiple>` element behaves similarly to a checkbox group.
```
<select multiple bind:value={fillings}>
<option value="Rice">Rice</option>
<option value="Beans">Beans</option>
<option value="Cheese">Cheese</option>
<option value="Guac (extra)">Guac (extra)</option>
</select>
```
When the value of an `<option>` matches its text content, the attribute can be omitted.
```
<select multiple bind:value={fillings}>
<option>Rice</option>
<option>Beans</option>
<option>Cheese</option>
<option>Guac (extra)</option>
</select>
```
Elements with the `contenteditable` attribute support `innerHTML` and `textContent` bindings.
```
<div contenteditable="true" bind:innerHTML={html}></div>
```
`<details>` elements support binding to the `open` property.
```
<details bind:open={isOpen}>
<summary>Details</summary>
<p>
Something small enough to escape casual notice.
</p>
</details>
```
##### Media element bindings
Media elements (`<audio>` and `<video>`) have their own set of bindings — six *readonly* ones...
* `duration` (readonly) — the total duration of the video, in seconds
* `buffered` (readonly) — an array of `{start, end}` objects
* `played` (readonly) — ditto
* `seekable` (readonly) — ditto
* `seeking` (readonly) — boolean
* `ended` (readonly) — boolean
...and five *two-way* bindings:
* `currentTime` — the current playback time in the video, in seconds
* `playbackRate` — how fast or slow to play the video, where 1 is 'normal'
* `paused` — this one should be self-explanatory
* `volume` — a value between 0 and 1
* `muted` — a boolean value indicating whether the player is muted
Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
```
<video
src={clip}
bind:duration
bind:buffered
bind:played
bind:seekable
bind:seeking
bind:ended
bind:currentTime
bind:playbackRate
bind:paused
bind:volume
bind:muted
bind:videoWidth
bind:videoHeight
></video>
```
##### Block-level element bindings
Block-level elements have 4 read-only bindings, measured using a technique similar to [this one](http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/):
* `clientWidth`
* `clientHeight`
* `offsetWidth`
* `offsetHeight`
```
<div
bind:offsetWidth={width}
bind:offsetHeight={height}
>
<Chart {width} {height}/>
</div>
```
#### bind:group
```
bind:group={variable}
```
Inputs that work together can use `bind:group`.
```
<script>
let tortilla = 'Plain';
let fillings = [];
</script>
<!-- grouped radio inputs are mutually exclusive -->
<input type="radio" bind:group={tortilla} value="Plain">
<input type="radio" bind:group={tortilla} value="Whole wheat">
<input type="radio" bind:group={tortilla} value="Spinach">
<!-- grouped checkbox inputs populate an array -->
<input type="checkbox" bind:group={fillings} value="Rice">
<input type="checkbox" bind:group={fillings} value="Beans">
<input type="checkbox" bind:group={fillings} value="Cheese">
<input type="checkbox" bind:group={fillings} value="Guac (extra)">
```
#### bind:this
```
bind:this={dom\_node}
```
To get a reference to a DOM node, use `bind:this`.
```
<script>
import { onMount } from 'svelte';
let canvasElement;
onMount(() => {
const ctx = canvasElement.getContext('2d');
drawStuff(ctx);
});
</script>
<canvas bind:this={canvasElement}></canvas>
```
#### class:*name*
```
class:name={value}
```
```
class:name
```
A `class:` directive provides a shorter way of toggling a class on an element.
```
<!-- These are equivalent -->
<div class="{active ? 'active' : ''}">...</div>
<div class:active={active}>...</div>
<!-- Shorthand, for when name and value match -->
<div class:active>...</div>
<!-- Multiple class toggles can be included -->
<div class:active class:inactive={!active} class:isAdmin>...</div>
```
#### style:*property*
```
style:property={value}
```
```
style:property="value"
```
```
style:property
```
The `style:` directive provides a shorthand for setting multiple styles on an element.
```
<!-- These are equivalent -->
<div style:color="red">...</div>
<div style="color: red;">...</div>
<!-- Variables can be used -->
<div style:color={myColor}>...</div>
<!-- Shorthand, for when property and variable name match -->
<div style:color>...</div>
<!-- Multiple styles can be included -->
<div style:color style:width="12rem" style:background-color={darkMode ? "black" : "white"}>...</div>
<!-- Styles can be marked as important -->
<div style:color|important="red">...</div>
```
When `style:` directives are combined with `style` attributes, the directives will take precedence:
```
<div style="color: blue;" style:color="red">This will be red</div>
```
#### use:*action*
```
use:action
```
```
use:action={parameters}
```
```
action = (node: HTMLElement, parameters: any) => {
update?: (parameters: any) => void,
destroy?: () => void
}
```
Actions are functions that are called when an element is created. They can return an object with a `destroy` method that is called after the element is unmounted:
```
<script>
function foo(node) {
// the node has been mounted in the DOM
return {
destroy() {
// the node has been removed from the DOM
}
};
}
</script>
<div use:foo></div>
```
An action can have a parameter. If the returned value has an `update` method, it will be called whenever that parameter changes, immediately after Svelte has applied updates to the markup.
> Don't worry about the fact that we're redeclaring the `foo` function for every component instance — Svelte will hoist any functions that don't depend on local state out of the component definition.
>
>
```
<script>
export let bar;
function foo(node, bar) {
// the node has been mounted in the DOM
return {
update(bar) {
// the value of `bar` has changed
},
destroy() {
// the node has been removed from the DOM
}
};
}
</script>
<div use:foo={bar}></div>
```
#### transition:*fn*
```
transition:fn
```
```
transition:fn={params}
```
```
transition:fn|local
```
```
transition:fn|local={params}
```
```
transition = (node: HTMLElement, params: any, options: { direction: 'in' | 'out' | 'both' }) => {
delay?: number,
duration?: number,
easing?: (t: number) => number,
css?: (t: number, u: number) => string,
tick?: (t: number, u: number) => void
}
```
A transition is triggered by an element entering or leaving the DOM as a result of a state change.
When a block is transitioning out, all elements inside the block, including those that do not have their own transitions, are kept in the DOM until every transition in the block has been completed.
The `transition:` directive indicates a *bidirectional* transition, which means it can be smoothly reversed while the transition is in progress.
```
{#if visible}
<div transition:fade>
fades in and out
</div>
{/if}
```
> By default intro transitions will not play on first render. You can modify this behaviour by setting `intro: true` when you [create a component](../docs#run-time-client-side-component-api).
>
>
##### Transition parameters
Like actions, transitions can have parameters.
(The double `{{curlies}}` aren't a special syntax; this is an object literal inside an expression tag.)
```
{#if visible}
<div transition:fade="{{ duration: 2000 }}">
fades in and out over two seconds
</div>
{/if}
```
##### Custom transition functions
Transitions can use custom functions. If the returned object has a `css` function, Svelte will create a CSS animation that plays on the element.
The `t` argument passed to `css` is a value between `0` and `1` after the `easing` function has been applied. *In* transitions run from `0` to `1`, *out* transitions run from `1` to `0` — in other words `1` is the element's natural state, as though no transition had been applied. The `u` argument is equal to `1 - t`.
The function is called repeatedly *before* the transition begins, with different `t` and `u` arguments.
```
<script>
import { elasticOut } from 'svelte/easing';
export let visible;
function whoosh(node, params) {
const existingTransform = getComputedStyle(node).transform.replace('none', '');
return {
delay: params.delay || 0,
duration: params.duration || 400,
easing: params.easing || elasticOut,
css: (t, u) => `transform: ${existingTransform} scale(${t})`
};
}
</script>
{#if visible}
<div in:whoosh>
whooshes in
</div>
{/if}
```
A custom transition function can also return a `tick` function, which is called *during* the transition with the same `t` and `u` arguments.
> If it's possible to use `css` instead of `tick`, do so — CSS animations can run off the main thread, preventing jank on slower devices.
>
>
```
<script>
export let visible = false;
function typewriter(node, { speed = 1 }) {
const valid = (
node.childNodes.length === 1 &&
node.childNodes[0].nodeType === Node.TEXT\_NODE
);
if (!valid) {
throw new Error(`This transition only works on elements with a single text node child`);
}
const text = node.textContent;
const duration = text.length / (speed \* 0.01);
return {
duration,
tick: t => {
const i = ~~(text.length \* t);
node.textContent = text.slice(0, i);
}
};
}
</script>
{#if visible}
<p in:typewriter="{{ speed: 1 }}">
The quick brown fox jumps over the lazy dog
</p>
{/if}
```
If a transition returns a function instead of a transition object, the function will be called in the next microtask. This allows multiple transitions to coordinate, making [crossfade effects](https://svelte.dev/tutorial/deferred-transitions) possible.
Transition functions also receive a third argument, `options`, which contains information about the transition.
Available values in the `options` object are:
* `direction` - one of `in`, `out`, or `both` depending on the type of transition
##### Transition events
An element with transitions will dispatch the following events in addition to any standard DOM events:
* `introstart`
* `introend`
* `outrostart`
* `outroend`
```
{#if visible}
<p
transition:fly="{{ y: 200, duration: 2000 }}"
on:introstart="{() => status = 'intro started'}"
on:outrostart="{() => status = 'outro started'}"
on:introend="{() => status = 'intro ended'}"
on:outroend="{() => status = 'outro ended'}"
>
Flies in and out
</p>
{/if}
```
Local transitions only play when the block they belong to is created or destroyed, *not* when parent blocks are created or destroyed.
```
{#if x}
{#if y}
<p transition:fade>
fades in and out when x or y change
</p>
<p transition:fade|local>
fades in and out only when y changes
</p>
{/if}
{/if}
```
#### in:*fn*/out:*fn*
```
in:fn
```
```
in:fn={params}
```
```
in:fn|local
```
```
in:fn|local={params}
```
```
out:fn
```
```
out:fn={params}
```
```
out:fn|local
```
```
out:fn|local={params}
```
Similar to `transition:`, but only applies to elements entering (`in:`) or leaving (`out:`) the DOM.
Unlike with `transition:`, transitions applied with `in:` and `out:` are not bidirectional — an in transition will continue to 'play' alongside the out transition, rather than reversing, if the block is outroed while the transition is in progress. If an out transition is aborted, transitions will restart from scratch.
```
{#if visible}
<div in:fly out:fade>
flies in, fades out
</div>
{/if}
```
#### animate:*fn*
```
animate:name
```
```
animate:name={params}
```
```
animation = (node: HTMLElement, { from: DOMRect, to: DOMRect } , params: any) => {
delay?: number,
duration?: number,
easing?: (t: number) => number,
css?: (t: number, u: number) => string,
tick?: (t: number, u: number) => void
}
```
```
DOMRect {
bottom: number,
height: number,
left: number,
right: number,
top: number,
width: number,
x: number,
y: number
}
```
An animation is triggered when the contents of a [keyed each block](../docs#template-syntax-each) are re-ordered. Animations do not run when an element is added or removed, only when the index of an existing data item within the each block changes. Animate directives must be on an element that is an *immediate* child of a keyed each block.
Animations can be used with Svelte's [built-in animation functions](../docs#run-time-svelte-animate) or [custom animation functions](../docs#template-syntax-element-directives-animate-fn-custom-animation-functions).
```
<!-- When `list` is reordered the animation will run-->
{#each list as item, index (item)}
<li animate:flip>{item}</li>
{/each}
```
##### Animation Parameters
As with actions and transitions, animations can have parameters.
(The double `{{curlies}}` aren't a special syntax; this is an object literal inside an expression tag.)
```
{#each list as item, index (item)}
<li animate:flip="{{ delay: 500 }}">{item}</li>
{/each}
```
##### Custom animation functions
Animations can use custom functions that provide the `node`, an `animation` object and any `parameters` as arguments. The `animation` parameter is an object containing `from` and `to` properties each containing a [DOMRect](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect#Properties) describing the geometry of the element in its `start` and `end` positions. The `from` property is the DOMRect of the element in its starting position, and the `to` property is the DOMRect of the element in its final position after the list has been reordered and the DOM updated.
If the returned object has a `css` method, Svelte will create a CSS animation that plays on the element.
The `t` argument passed to `css` is a value that goes from `0` and `1` after the `easing` function has been applied. The `u` argument is equal to `1 - t`.
The function is called repeatedly *before* the animation begins, with different `t` and `u` arguments.
```
<script>
import { cubicOut } from 'svelte/easing';
function whizz(node, { from, to }, params) {
const dx = from.left - to.left;
const dy = from.top - to.top;
const d = Math.sqrt(dx \* dx + dy \* dy);
return {
delay: 0,
duration: Math.sqrt(d) \* 120,
easing: cubicOut,
css: (t, u) =>
`transform: translate(${u \* dx}px, ${u \* dy}px) rotate(${t\*360}deg);`
};
}
</script>
{#each list as item, index (item)}
<div animate:whizz>{item}</div>
{/each}
```
A custom animation function can also return a `tick` function, which is called *during* the animation with the same `t` and `u` arguments.
> If it's possible to use `css` instead of `tick`, do so — CSS animations can run off the main thread, preventing jank on slower devices.
>
>
```
<script>
import { cubicOut } from 'svelte/easing';
function whizz(node, { from, to }, params) {
const dx = from.left - to.left;
const dy = from.top - to.top;
const d = Math.sqrt(dx \* dx + dy \* dy);
return {
delay: 0,
duration: Math.sqrt(d) \* 120,
easing: cubicOut,
tick: (t, u) =>
Object.assign(node.style, {
color: t > 0.5 ? 'Pink' : 'Blue'
});
};
}
</script>
{#each list as item, index (item)}
<div animate:whizz>{item}</div>
{/each}
```
### Component directives
#### on:*eventname*
```
on:eventname={handler}
```
Components can emit events using [createEventDispatcher](../docs#run-time-svelte-createeventdispatcher), or by forwarding DOM events. Listening for component events looks the same as listening for DOM events:
```
<SomeComponent on:whatever={handler}/>
```
As with DOM events, if the `on:` directive is used without a value, the component will *forward* the event, meaning that a consumer of the component can listen for it.
```
<SomeComponent on:whatever/>
```
#### --style-props
```
--style-props="anycssvalue"
```
You can also pass styles as props to components for the purposes of theming, using CSS custom properties.
Svelte's implementation is essentially syntactic sugar for adding a wrapper element. This example:
```
<Slider
bind:value
min={0}
--rail-color="black"
--track-color="rgb(0, 0, 255)"
/>
```
Desugars to this:
```
<div style="display: contents; --rail-color: black; --track-color: rgb(0, 0, 255)">
<Slider
bind:value
min={0}
max={100}
/>
</div>
```
**Note**: Since this is an extra `<div>`, beware that your CSS structure might accidentally target this. Be mindful of this added wrapper element when using this feature.
For SVG namespace, the example above desugars into using `<g>` instead:
```
<g style="--rail-color: black; --track-color: rgb(0, 0, 255)">
<Slider
bind:value
min={0}
max={100}
/>
</g>
```
**Note**: Since this is an extra `<g>`, beware that your CSS structure might accidentally target this. Be mindful of this added wrapper element when using this feature.
Svelte's CSS Variables support allows for easily themeable components:
```
<!-- Slider.svelte -->
<style>
.potato-slider-rail {
background-color: var(--rail-color, var(--theme-color, 'purple'));
}
</style>
```
So you can set a high level theme color:
```
/\* global.css \*/
html {
--theme-color: black;
}
```
Or override it at the consumer level:
```
<Slider --rail-color="goldenrod"/>
```
#### bind:*property*
```
bind:property={variable}
```
You can bind to component props using the same syntax as for elements.
```
<Keypad bind:value={pin}/>
```
#### bind:this
```
bind:this={component\_instance}
```
Components also support `bind:this`, allowing you to interact with component instances programmatically.
> Note that we can't do `{cart.empty}` since `cart` is `undefined` when the button is first rendered and throws an error.
>
>
```
<ShoppingCart bind:this={cart}/>
<button on:click={() => cart.empty()}>
Empty shopping cart
</button>
```
### `<slot>`
```
<slot><!-- optional fallback --></slot>
```
```
<slot name="x"><!-- optional fallback --></slot>
```
```
<slot prop={value}></slot>
```
Components can have child content, in the same way that elements can.
The content is exposed in the child component using the `<slot>` element, which can contain fallback content that is rendered if no children are provided.
```
<!-- Widget.svelte -->
<div>
<slot>
this fallback content will be rendered when no content is provided, like in the first example
</slot>
</div>
<!-- App.svelte -->
<Widget></Widget> <!-- this component will render the default content -->
<Widget>
<p>this is some child content that will overwrite the default slot content</p>
</Widget>
```
####
`<slot name="`*name*`">`
Named slots allow consumers to target specific areas. They can also have fallback content.
```
<!-- Widget.svelte -->
<div>
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
<!-- App.svelte -->
<Widget>
<h1 slot="header">Hello</h1>
<p slot="footer">Copyright (c) 2019 Svelte Industries</p>
</Widget>
```
Components can be placed in a named slot using the syntax `<Component slot="name" />`. In order to place content in a slot without using a wrapper element, you can use the special element `<svelte:fragment>`.
```
<!-- Widget.svelte -->
<div>
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
<!-- App.svelte -->
<Widget>
<HeaderComponent slot="header" />
<svelte:fragment slot="footer">
<p>All rights reserved.</p>
<p>Copyright (c) 2019 Svelte Industries</p>
</svelte:fragment>
</Widget>
```
#### `$$slots`
`$$slots` is an object whose keys are the names of the slots passed into the component by the parent. If the parent does not pass in a slot with a particular name, that name will not be present in `$$slots`. This allows components to render a slot (and other elements, like wrappers for styling) only if the parent provides it.
Note that explicitly passing in an empty named slot will add that slot's name to `$$slots`. For example, if a parent passes `<div slot="title" />` to a child component, `$$slots.title` will be truthy within the child.
```
<!-- Card.svelte -->
<div>
<slot name="title"></slot>
{#if $$slots.description}
<!-- This <hr> and slot will render only if a slot named "description" is provided. -->
<hr>
<slot name="description"></slot>
{/if}
</div>
<!-- App.svelte -->
<Card>
<h1 slot="title">Blog Post Title</h1>
<!-- No slot named "description" was provided so the optional slot will not be rendered. -->
</Card>
```
####
`<slot key={`*value*`}>`
Slots can be rendered zero or more times, and can pass values *back* to the parent using props. The parent exposes the values to the slot template using the `let:` directive.
The usual shorthand rules apply — `let:item` is equivalent to `let:item={item}`, and `<slot {item}>` is equivalent to `<slot item={item}>`.
```
<!-- FancyList.svelte -->
<ul>
{#each items as item}
<li class="fancy">
<slot prop={item}></slot>
</li>
{/each}
</ul>
<!-- App.svelte -->
<FancyList {items} let:prop={thing}>
<div>{thing.text}</div>
</FancyList>
```
Named slots can also expose values. The `let:` directive goes on the element with the `slot` attribute.
```
<!-- FancyList.svelte -->
<ul>
{#each items as item}
<li class="fancy">
<slot name="item" {item}></slot>
</li>
{/each}
</ul>
<slot name="footer"></slot>
<!-- App.svelte -->
<FancyList {items}>
<div slot="item" let:item>{item.text}</div>
<p slot="footer">Copyright (c) 2019 Svelte Industries</p>
</FancyList>
```
### `<svelte:self>`
The `<svelte:self>` element allows a component to include itself, recursively.
It cannot appear at the top level of your markup; it must be inside an if or each block or passed to a component's slot to prevent an infinite loop.
```
<script>
export let count;
</script>
{#if count > 0}
<p>counting down... {count}</p>
<svelte:self count="{count - 1}"/>
{:else}
<p>lift-off!</p>
{/if}
```
### `<svelte:component>`
```
<svelte:component this={expression}/>
```
The `<svelte:component>` element renders a component dynamically, using the component constructor specified as the `this` property. When the property changes, the component is destroyed and recreated.
If `this` is falsy, no component is rendered.
```
<svelte:component this={currentSelection.component} foo={bar}/>
```
### `<svelte:element>`
```
<svelte:element this={expression}/>
```
The `<svelte:element>` element lets you render an element of a dynamically specified type. This is useful for example when displaying rich text content from a CMS. Any properties and event listeners present will be applied to the element.
The only supported binding is `bind:this`, since the element type specific bindings that Svelte does at build time (e.g. `bind:value` for input elements) do not work with a dynamic tag type.
If `this` has a nullish value, the element and its children will not be rendered.
If `this` is the name of a void tag (e.g., `br`) and `<svelte:element>` has child elements, a runtime error will be thrown in development mode.
```
<script>
let tag = 'div';
export let handler;
</script>
<svelte:element this={tag} on:click={handler}>Foo</svelte:element>
```
### `<svelte:window>`
```
<svelte:window on:event={handler}/>
```
```
<svelte:window bind:prop={value}/>
```
The `<svelte:window>` element allows you to add event listeners to the `window` object without worrying about removing them when the component is destroyed, or checking for the existence of `window` when server-side rendering.
Unlike `<svelte:self>`, this element may only appear at the top level of your component and must never be inside a block or element.
```
<script>
function handleKeydown(event) {
alert(`pressed the ${event.key} key`);
}
</script>
<svelte:window on:keydown={handleKeydown}/>
```
You can also bind to the following properties:
* `innerWidth`
* `innerHeight`
* `outerWidth`
* `outerHeight`
* `scrollX`
* `scrollY`
* `online` — an alias for window.navigator.onLine
All except `scrollX` and `scrollY` are readonly.
```
<svelte:window bind:scrollY={y}/>
```
> Note that the page will not be scrolled to the initial value to avoid accessibility issues. Only subsequent changes to the bound variable of `scrollX` and `scrollY` will cause scrolling. However, if the scrolling behaviour is desired, call `scrollTo()` in `onMount()`.
>
>
### `<svelte:body>`
```
<svelte:body on:event={handler}/>
```
Similarly to `<svelte:window>`, this element allows you to add listeners to events on `document.body`, such as `mouseenter` and `mouseleave`, which don't fire on `window`. It also lets you use [actions](../docs#template-syntax-element-directives-use-action) on the `<body>` element.
As with `<svelte:window>`, this element may only appear the top level of your component and must never be inside a block or element.
```
<svelte:body
on:mouseenter={handleMouseenter}
on:mouseleave={handleMouseleave}
use:someAction
/>
```
### `<svelte:head>`
```
<svelte:head>...</svelte:head>
```
This element makes it possible to insert elements into `document.head`. During server-side rendering, `head` content is exposed separately to the main `html` content.
As with `<svelte:window>` and `<svelte:body>`, this element may only appear at the top level of your component and must never be inside a block or element.
```
<svelte:head>
<link rel="stylesheet" href="/tutorial/dark-theme.css">
</svelte:head>
```
### `<svelte:options>`
```
<svelte:options option={value}/>
```
The `<svelte:options>` element provides a place to specify per-component compiler options, which are detailed in the [compiler section](../docs#compile-time-svelte-compile). The possible options are:
* `immutable={true}` — you never use mutable data, so the compiler can do simple referential equality checks to determine if values have changed
* `immutable={false}` — the default. Svelte will be more conservative about whether or not mutable objects have changed
* `accessors={true}` — adds getters and setters for the component's props
* `accessors={false}` — the default
* `namespace="..."` — the namespace where this component will be used, most commonly "svg"; use the "foreign" namespace to opt out of case-insensitive attribute names and HTML-specific warnings
* `tag="..."` — the name to use when compiling this component as a custom element
```
<svelte:options tag="my-custom-element"/>
```
### `<svelte:fragment>`
The `<svelte:fragment>` element allows you to place content in a [named slot](../docs#template-syntax-slot-slot-name-name) without wrapping it in a container DOM element. This keeps the flow layout of your document intact.
```
<!-- Widget.svelte -->
<div>
<slot name="header">No header was provided</slot>
<p>Some content between header and footer</p>
<slot name="footer"></slot>
</div>
<!-- App.svelte -->
<Widget>
<h1 slot="header">Hello</h1>
<svelte:fragment slot="footer">
<p>All rights reserved.</p>
<p>Copyright (c) 2019 Svelte Industries</p>
</svelte:fragment>
</Widget>
```
Run time
--------
### `svelte`
The `svelte` package exposes [lifecycle functions](https://svelte.dev/tutorial/onmount) and the [context API](https://svelte.dev/tutorial/context-api).
#### `onMount`
```
onMount(callback: () => void)
```
```
onMount(callback: () => () => void)
```
The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM. It must be called during the component's initialisation (but doesn't need to live *inside* the component; it can be called from an external module).
`onMount` does not run inside a [server-side component](../docs#run-time-server-side-component-api).
```
<script>
import { onMount } from 'svelte';
onMount(() => {
console.log('the component has mounted');
});
</script>
```
If a function is returned from `onMount`, it will be called when the component is unmounted.
```
<script>
import { onMount } from 'svelte';
onMount(() => {
const interval = setInterval(() => {
console.log('beep');
}, 1000);
return () => clearInterval(interval);
});
</script>
```
> This behaviour will only work when the function passed to `onMount` *synchronously* returns a value. `async` functions always return a `Promise`, and as such cannot *synchronously* return a function.
>
>
#### `beforeUpdate`
```
beforeUpdate(callback: () => void)
```
Schedules a callback to run immediately before the component is updated after any state change.
> The first time the callback runs will be before the initial `onMount`
>
>
```
<script>
import { beforeUpdate } from 'svelte';
beforeUpdate(() => {
console.log('the component is about to update');
});
</script>
```
#### `afterUpdate`
```
afterUpdate(callback: () => void)
```
Schedules a callback to run immediately after the component has been updated.
> The first time the callback runs will be after the initial `onMount`
>
>
```
<script>
import { afterUpdate } from 'svelte';
afterUpdate(() => {
console.log('the component just updated');
});
</script>
```
#### `onDestroy`
```
onDestroy(callback: () => void)
```
Schedules a callback to run immediately before the component is unmounted.
Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the only one that runs inside a server-side component.
```
<script>
import { onDestroy } from 'svelte';
onDestroy(() => {
console.log('the component is being destroyed');
});
</script>
```
#### `tick`
```
promise: Promise = tick()
```
Returns a promise that resolves once any pending state changes have been applied, or in the next microtask if there are none.
```
<script>
import { beforeUpdate, tick } from 'svelte';
beforeUpdate(async () => {
console.log('the component is about to update');
await tick();
console.log('the component just updated');
});
</script>
```
#### `setContext`
```
setContext(key: any, context: any)
```
Associates an arbitrary `context` object with the current component and the specified `key` and returns that object. The context is then available to children of the component (including slotted content) with `getContext`.
Like lifecycle functions, this must be called during component initialisation.
```
<script>
import { setContext } from 'svelte';
setContext('answer', 42);
</script>
```
> Context is not inherently reactive. If you need reactive values in context then you can pass a store into context, which *will* be reactive.
>
>
#### `getContext`
```
context: any = getContext(key: any)
```
Retrieves the context that belongs to the closest parent component with the specified `key`. Must be called during component initialisation.
```
<script>
import { getContext } from 'svelte';
const answer = getContext('answer');
</script>
```
#### `hasContext`
```
hasContext: boolean = hasContext(key: any)
```
Checks whether a given `key` has been set in the context of a parent component. Must be called during component initialisation.
```
<script>
import { hasContext } from 'svelte';
if (hasContext('answer')) {
// do something
}
</script>
```
#### `getAllContexts`
```
contexts: Map<any, any> = getAllContexts()
```
Retrieves the whole context map that belongs to the closest parent component. Must be called during component initialisation. Useful, for example, if you programmatically create a component and want to pass the existing context to it.
```
<script>
import { getAllContexts } from 'svelte';
const contexts = getAllContexts();
</script>
```
#### `createEventDispatcher`
```
dispatch: ((name: string, detail?: any, options?: DispatchOptions) => boolean) = createEventDispatcher();
```
Creates an event dispatcher that can be used to dispatch [component events](../docs#template-syntax-component-directives-on-eventname). Event dispatchers are functions that can take two arguments: `name` and `detail`.
Component events created with `createEventDispatcher` create a [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent). These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture). The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail) property and can contain any type of data.
```
<script>
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
</script>
<button on:click="{() => dispatch('notify', 'detail value')}">Fire Event</button>
```
Events dispatched from child components can be listened to in their parent. Any data provided when the event was dispatched is available on the `detail` property of the event object.
```
<script>
function callbackFunction(event) {
console.log(`Notify fired! Detail: ${event.detail}`)
}
</script>
<Child on:notify="{callbackFunction}"/>
```
Events can be cancelable by passing a third parameter to the dispatch function. The function returns `false` if the event is cancelled with `event.preventDefault()`, otherwise it returns `true`.
```
<script>
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
function notify() {
const shouldContinue = dispatch('notify', 'detail value', { cancelable: true });
if (shouldContinue) {
// no one called preventDefault
} else {
// a listener called preventDefault
}
}
</script>
```
### `svelte/store`
The `svelte/store` module exports functions for creating [readable](../docs#run-time-svelte-store-readable), [writable](../docs#run-time-svelte-store-writable) and [derived](../docs#run-time-svelte-store-derived) stores.
Keep in mind that you don't *have* to use these functions to enjoy the [reactive `$store` syntax](../docs#component-format-script-4-prefix-stores-with-%24-to-access-their-values) in your components. Any object that correctly implements `.subscribe`, unsubscribe, and (optionally) `.set` is a valid store, and will work both with the special syntax, and with Svelte's built-in [`derived` stores](../docs#run-time-svelte-store-derived).
This makes it possible to wrap almost any other reactive state handling library for use in Svelte. Read more about the [store contract](../docs#component-format-script-4-prefix-stores-with-%24-to-access-their-values-store-contract) to see what a correct implementation looks like.
#### `writable`
```
store = writable(value?: any)
```
```
store = writable(value?: any, start?: (set: (value: any) => void) => () => void)
```
Function that creates a store which has values that can be set from 'outside' components. It gets created as an object with additional `set` and `update` methods.
`set` is a method that takes one argument which is the value to be set. The store value gets set to the value of the argument if the store value is not already equal to it.
`update` is a method that takes one argument which is a callback. The callback takes the existing store value as its argument and returns the new value to be set to the store.
```
import { writable } from 'svelte/store';
const count = writable(0);
count.subscribe(value => {
console.log(value);
}); // logs '0'
count.set(1); // logs '1'
count.update(n => n + 1); // logs '2'
```
If a function is passed as the second argument, it will be called when the number of subscribers goes from zero to one (but not from one to two, etc). That function will be passed a `set` function which changes the value of the store. It must return a `stop` function that is called when the subscriber count goes from one to zero.
```
import { writable } from 'svelte/store';
const count = writable(0, () => {
console.log('got a subscriber');
return () => console.log('no more subscribers');
});
count.set(1); // does nothing
const unsubscribe = count.subscribe(value => {
console.log(value);
}); // logs 'got a subscriber', then '1'
unsubscribe(); // logs 'no more subscribers'
```
Note that the value of a `writable` is lost when it is destroyed, for example when the page is refreshed. However, you can write your own logic to sync the value to for example the `localStorage`.
#### `readable`
```
store = readable(value?: any, start?: (set: (value: any) => void) => () => void)
```
Creates a store whose value cannot be set from 'outside', the first argument is the store's initial value, and the second argument to `readable` is the same as the second argument to `writable`.
```
import { readable } from 'svelte/store';
const time = readable(null, set => {
set(new Date());
const interval = setInterval(() => {
set(new Date());
}, 1000);
return () => clearInterval(interval);
});
```
#### `derived`
```
store = derived(a, callback: (a: any) => any)
```
```
store = derived(a, callback: (a: any, set: (value: any) => void) => void | () => void, initial_value: any)
```
```
store = derived([a, ...b], callback: ([a: any, ...b: any[]]) => any)
```
```
store = derived([a, ...b], callback: ([a: any, ...b: any[]], set: (value: any) => void) => void | () => void, initial_value: any)
```
Derives a store from one or more other stores. The callback runs initially when the first subscriber subscribes and then whenever the store dependencies change.
In the simplest version, `derived` takes a single store, and the callback returns a derived value.
```
import { derived } from 'svelte/store';
const doubled = derived(a, $a => $a \* 2);
```
The callback can set a value asynchronously by accepting a second argument, `set`, and calling it when appropriate.
In this case, you can also pass a third argument to `derived` — the initial value of the derived store before `set` is first called.
```
import { derived } from 'svelte/store';
const delayed = derived(a, ($a, set) => {
setTimeout(() => set($a), 1000);
}, 'one moment...');
```
If you return a function from the callback, it will be called when a) the callback runs again, or b) the last subscriber unsubscribes.
```
import { derived } from 'svelte/store';
const tick = derived(frequency, ($frequency, set) => {
const interval = setInterval(() => {
set(Date.now());
}, 1000 / $frequency);
return () => {
clearInterval(interval);
};
}, 'one moment...');
```
In both cases, an array of arguments can be passed as the first argument instead of a single store.
```
import { derived } from 'svelte/store';
const summed = derived([a, b], ([$a, $b]) => $a + $b);
const delayed = derived([a, b], ([$a, $b], set) => {
setTimeout(() => set($a + $b), 1000);
});
```
#### `get`
```
value: any = get(store)
```
Generally, you should read the value of a store by subscribing to it and using the value as it changes over time. Occasionally, you may need to retrieve the value of a store to which you're not subscribed. `get` allows you to do so.
> This works by creating a subscription, reading the value, then unsubscribing. It's therefore not recommended in hot code paths.
>
>
```
import { get } from 'svelte/store';
const value = get(store);
```
### `svelte/motion`
The `svelte/motion` module exports two functions, `tweened` and `spring`, for creating writable stores whose values change over time after `set` and `update`, rather than immediately.
#### `tweened`
```
store = tweened(value: any, options)
```
Tweened stores update their values over a fixed duration. The following options are available:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number` | `function`, default 400) — milliseconds the tween lasts
* `easing` (`function`, default `t => t`) — an [easing function](../docs#run-time-svelte-easing)
* `interpolate` (`function`) — see below
`store.set` and `store.update` can accept a second `options` argument that will override the options passed in upon instantiation.
Both functions return a Promise that resolves when the tween completes. If the tween is interrupted, the promise will never resolve.
Out of the box, Svelte will interpolate between two numbers, two arrays or two objects (as long as the arrays and objects are the same 'shape', and their 'leaf' properties are also numbers).
```
<script>
import { tweened } from 'svelte/motion';
import { cubicOut } from 'svelte/easing';
const size = tweened(1, {
duration: 300,
easing: cubicOut
});
function handleClick() {
// this is equivalent to size.update(n => n + 1)
$size += 1;
}
</script>
<button
on:click={handleClick}
style="transform: scale({$size}); transform-origin: 0 0"
>embiggen</button>
```
If the initial value is `undefined` or `null`, the first value change will take effect immediately. This is useful when you have tweened values that are based on props, and don't want any motion when the component first renders.
```
const size = tweened(undefined, {
duration: 300,
easing: cubicOut
});
$: $size = big ? 100 : 10;
```
The `interpolate` option allows you to tween between *any* arbitrary values. It must be an `(a, b) => t => value` function, where `a` is the starting value, `b` is the target value, `t` is a number between 0 and 1, and `value` is the result. For example, we can use the [d3-interpolate](https://github.com/d3/d3-interpolate) package to smoothly interpolate between two colours.
```
<script>
import { interpolateLab } from 'd3-interpolate';
import { tweened } from 'svelte/motion';
const colors = [
'rgb(255, 62, 0)',
'rgb(64, 179, 255)',
'rgb(103, 103, 120)'
];
const color = tweened(colors[0], {
duration: 800,
interpolate: interpolateLab
});
</script>
{#each colors as c}
<button
style="background-color: {c}; color: white; border: none;"
on:click="{e => color.set(c)}"
>{c}</button>
{/each}
<h1 style="color: {$color}">{$color}</h1>
```
#### `spring`
```
store = spring(value: any, options)
```
A `spring` store gradually changes to its target value based on its `stiffness` and `damping` parameters. Whereas `tweened` stores change their values over a fixed duration, `spring` stores change over a duration that is determined by their existing velocity, allowing for more natural-seeming motion in many situations. The following options are available:
* `stiffness` (`number`, default `0.15`) — a value between 0 and 1 where higher means a 'tighter' spring
* `damping` (`number`, default `0.8`) — a value between 0 and 1 where lower means a 'springier' spring
* `precision` (`number`, default `0.01`) — determines the threshold at which the spring is considered to have 'settled', where lower means more precise
All of the options above can be changed while the spring is in motion, and will take immediate effect.
```
const size = spring(100);
size.stiffness = 0.3;
size.damping = 0.4;
size.precision = 0.005;
```
As with [`tweened`](../docs#run-time-svelte-motion-tweened) stores, `set` and `update` return a Promise that resolves if the spring settles.
Both `set` and `update` can take a second argument — an object with `hard` or `soft` properties. `{ hard: true }` sets the target value immediately; `{ soft: n }` preserves existing momentum for `n` seconds before settling. `{ soft: true }` is equivalent to `{ soft: 0.5 }`.
```
const coords = spring({ x: 50, y: 50 });
// updates the value immediately
coords.set({ x: 100, y: 200 }, { hard: true });
// preserves existing momentum for 1s
coords.update(
(target\_coords, coords) => {
return { x: target_coords.x, y: coords.y };
},
{ soft: 1 }
);
```
[See a full example on the spring tutorial.](https://svelte.dev/tutorial/spring)
```
<script>
import { spring } from 'svelte/motion';
const coords = spring({ x: 50, y: 50 }, {
stiffness: 0.1,
damping: 0.25
});
</script>
```
If the initial value is `undefined` or `null`, the first value change will take effect immediately, just as with `tweened` values (see above).
```
const size = spring();
$: $size = big ? 100 : 10;
```
### `svelte/transition`
The `svelte/transition` module exports seven functions: `fade`, `blur`, `fly`, `slide`, `scale`, `draw` and `crossfade`. They are for use with Svelte [`transitions`](../docs#template-syntax-element-directives-transition-fn).
#### `fade`
```
transition:fade={params}
```
```
in:fade={params}
```
```
out:fade={params}
```
Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions.
`fade` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number`, default 400) — milliseconds the transition lasts
* `easing` (`function`, default `linear`) — an [easing function](../docs#run-time-svelte-easing)
You can see the `fade` transition in action in the [transition tutorial](https://svelte.dev/tutorial/transition).
```
<script>
import { fade } from 'svelte/transition';
</script>
{#if condition}
<div transition:fade="{{delay: 250, duration: 300}}">
fades in and out
</div>
{/if}
```
#### `blur`
```
transition:blur={params}
```
```
in:blur={params}
```
```
out:blur={params}
```
Animates a `blur` filter alongside an element's opacity.
`blur` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number`, default 400) — milliseconds the transition lasts
* `easing` (`function`, default `cubicInOut`) — an [easing function](../docs#run-time-svelte-easing)
* `opacity` (`number`, default 0) - the opacity value to animate out to and in from
* `amount` (`number`, default 5) - the size of the blur in pixels
```
<script>
import { blur } from 'svelte/transition';
</script>
{#if condition}
<div transition:blur="{{amount: 10}}">
fades in and out
</div>
{/if}
```
#### `fly`
```
transition:fly={params}
```
```
in:fly={params}
```
```
out:fly={params}
```
Animates the x and y positions and the opacity of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values.
`fly` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number`, default 400) — milliseconds the transition lasts
* `easing` (`function`, default `cubicOut`) — an [easing function](../docs#run-time-svelte-easing)
* `x` (`number`, default 0) - the x offset to animate out to and in from
* `y` (`number`, default 0) - the y offset to animate out to and in from
* `opacity` (`number`, default 0) - the opacity value to animate out to and in from
You can see the `fly` transition in action in the [transition tutorial](https://svelte.dev/tutorial/adding-parameters-to-transitions).
```
<script>
import { fly } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
</script>
{#if condition}
<div transition:fly="{{delay: 250, duration: 300, x: 100, y: 500, opacity: 0.5, easing: quintOut}}">
flies in and out
</div>
{/if}
```
#### `slide`
```
transition:slide={params}
```
```
in:slide={params}
```
```
out:slide={params}
```
Slides an element in and out.
`slide` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number`, default 400) — milliseconds the transition lasts
* `easing` (`function`, default `cubicOut`) — an [easing function](../docs#run-time-svelte-easing)
```
<script>
import { slide } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
</script>
{#if condition}
<div transition:slide="{{delay: 250, duration: 300, easing: quintOut }}">
slides in and out
</div>
{/if}
```
#### `scale`
```
transition:scale={params}
```
```
in:scale={params}
```
```
out:scale={params}
```
Animates the opacity and scale of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values.
`scale` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number`, default 400) — milliseconds the transition lasts
* `easing` (`function`, default `cubicOut`) — an [easing function](../docs#run-time-svelte-easing)
* `start` (`number`, default 0) - the scale value to animate out to and in from
* `opacity` (`number`, default 0) - the opacity value to animate out to and in from
```
<script>
import { scale } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
</script>
{#if condition}
<div transition:scale="{{duration: 500, delay: 500, opacity: 0.5, start: 0.5, easing: quintOut}}">
scales in and out
</div>
{/if}
```
#### `draw`
```
transition:draw={params}
```
```
in:draw={params}
```
```
out:draw={params}
```
Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `<path>` and `<polyline>`.
`draw` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `speed` (`number`, default undefined) - the speed of the animation, see below.
* `duration` (`number` | `function`, default 800) — milliseconds the transition lasts
* `easing` (`function`, default `cubicInOut`) — an [easing function](../docs#run-time-svelte-easing)
The `speed` parameter is a means of setting the duration of the transition relative to the path's length. It is a modifier that is applied to the length of the path: `duration = length / speed`. A path that is 1000 pixels with a speed of 1 will have a duration of `1000ms`, setting the speed to `0.5` will double that duration and setting it to `2` will halve it.
```
<script>
import { draw } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
</script>
<svg viewBox="0 0 5 5" xmlns="http://www.w3.org/2000/svg">
{#if condition}
<path transition:draw="{{duration: 5000, delay: 500, easing: quintOut}}"
d="M2 1 h1 v1 h1 v1 h-1 v1 h-1 v-1 h-1 v-1 h1 z"
fill="none"
stroke="cornflowerblue"
stroke-width="0.1px"
stroke-linejoin="round"
/>
{/if}
</svg>
```
#### `crossfade`
The `crossfade` function creates a pair of [transitions](../docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used.
`crossfade` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number` | `function`, default 800) — milliseconds the transition lasts
* `easing` (`function`, default `cubicOut`) — an [easing function](../docs#run-time-svelte-easing)
* `fallback` (`function`) — A fallback [transition](../docs#template-syntax-element-directives-transition-fn) to use for send when there is no matching element being received, and for receive when there is no element being sent.
```
<script>
import { crossfade } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
const [send, receive] = crossfade({
duration:1500,
easing: quintOut
});
</script>
{#if condition}
<h1 in:send={{key}} out:receive={{key}}>BIG ELEM</h1>
{:else}
<small in:send={{key}} out:receive={{key}}>small elem</small>
{/if}
```
### `svelte/animate`
The `svelte/animate` module exports one function for use with Svelte [animations](../docs#template-syntax-element-directives-animate-fn).
#### `flip`
```
animate:flip={params}
```
The `flip` function calculates the start and end position of an element and animates between them, translating the `x` and `y` values. `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).
`flip` accepts the following parameters:
* `delay` (`number`, default 0) — milliseconds before starting
* `duration` (`number` | `function`, default `d => Math.sqrt(d) * 120`) — see below
* `easing` (`function`, default `cubicOut`) — an [easing function](../docs#run-time-svelte-easing)
`duration` can be provided as either:
* a `number`, in milliseconds.
* a function, `distance: number => duration: number`, receiving the distance the element will travel in pixels and returning the duration in milliseconds. This allows you to assign a duration that is relative to the distance travelled by each element.
You can see a full example on the [animations tutorial](https://svelte.dev/tutorial/animate)
```
<script>
import { flip } from 'svelte/animate';
import { quintOut } from 'svelte/easing';
let list = [1, 2, 3];
</script>
{#each list as n (n)}
<div animate:flip="{{delay: 250, duration: 250, easing: quintOut}}">
{n}
</div>
{/each}
```
### `svelte/easing`
Easing functions specify the rate of change over time and are useful when working with Svelte's built-in transitions and animations as well as the tweened and spring utilities. `svelte/easing` contains 31 named exports, a `linear` ease and 3 variants of 10 different easing functions: `in`, `out` and `inOut`.
You can explore the various eases using the [ease visualiser](https://svelte.dev/examples/easing) in the [examples section](https://svelte.dev/examples).
| ease | in | out | inOut |
| --- | --- | --- | --- |
| **back** | `backIn` | `backOut` | `backInOut` |
| **bounce** | `bounceIn` | `bounceOut` | `bounceInOut` |
| **circ** | `circIn` | `circOut` | `circInOut` |
| **cubic** | `cubicIn` | `cubicOut` | `cubicInOut` |
| **elastic** | `elasticIn` | `elasticOut` | `elasticInOut` |
| **expo** | `expoIn` | `expoOut` | `expoInOut` |
| **quad** | `quadIn` | `quadOut` | `quadInOut` |
| **quart** | `quartIn` | `quartOut` | `quartInOut` |
| **quint** | `quintIn` | `quintOut` | `quintInOut` |
| **sine** | `sineIn` | `sineOut` | `sineInOut` |
### `svelte/register`
To render Svelte components in Node.js without bundling, use `require('svelte/register')`. After that, you can use `require` to include any `.svelte` file.
```
require('svelte/register');
const App = require('./App.svelte').default;
...
const { html, css, head } = App.render({ answer: 42 });
```
> The `.default` is necessary because we're converting from native JavaScript modules to the CommonJS modules recognised by Node. Note that if your component imports JavaScript modules, they will fail to load in Node and you will need to use a bundler instead.
>
>
To set compile options, or to use a custom file extension, call the `register` hook as a function:
```
require('svelte/register')({
extensions: ['.customextension'], // defaults to ['.html', '.svelte']
preserveComments: true
});
```
### Client-side component API
#### Creating a component
```
const component = new Component(options)
```
A client-side component — that is, a component compiled with `generate: 'dom'` (or the `generate` option left unspecified) is a JavaScript class.
```
import App from './App.svelte';
const app = new App({
target: document.body,
props: {
// assuming App.svelte contains something like
// `export let answer`:
answer: 42
}
});
```
The following initialisation options can be provided:
| option | default | description |
| --- | --- | --- |
| `target` | **none** | An `HTMLElement` or `ShadowRoot` to render to. This option is required |
| `anchor` | `null` | A child of `target` to render the component immediately before |
| `props` | `{}` | An object of properties to supply to the component |
| `context` | `new Map()` | A `Map` of root-level context key-value pairs to supply to the component |
| `hydrate` | `false` | See below |
| `intro` | `false` | If `true`, will play transitions on initial render, rather than waiting for subsequent state changes |
Existing children of `target` are left where they are.
The `hydrate` option instructs Svelte to upgrade existing DOM (usually from server-side rendering) rather than creating new elements. It will only work if the component was compiled with the [`hydratable: true` option](../docs#compile-time-svelte-compile). Hydration of `<head>` elements only works properly if the server-side rendering code was also compiled with `hydratable: true`, which adds a marker to each element in the `<head>` so that the component knows which elements it's responsible for removing during hydration.
Whereas children of `target` are normally left alone, `hydrate: true` will cause any children to be removed. For that reason, the `anchor` option cannot be used alongside `hydrate: true`.
The existing DOM doesn't need to match the component — Svelte will 'repair' the DOM as it goes.
```
import App from './App.svelte';
const app = new App({
target: document.querySelector('#server-rendered-html'),
hydrate: true
});
```
#### `$set`
```
component.$set(props)
```
Programmatically sets props on an instance. `component.$set({ x: 1 })` is equivalent to `x = 1` inside the component's `<script>` block.
Calling this method schedules an update for the next microtask — the DOM is *not* updated synchronously.
```
component.$set({ answer: 42 });
```
#### `$on`
```
component.$on(event, callback)
```
Causes the `callback` function to be called whenever the component dispatches an `event`.
A function is returned that will remove the event listener when called.
```
const off = app.$on('selected', event => {
console.log(event.detail.selection);
});
off();
```
#### `$destroy`
```
component.$destroy()
```
Removes a component from the DOM and triggers any `onDestroy` handlers.
#### Component props
```
component.prop
```
```
component.prop = value
```
If a component is compiled with `accessors: true`, each instance will have getters and setters corresponding to each of the component's props. Setting a value will cause a *synchronous* update, rather than the default async update caused by `component.$set(...)`.
By default, `accessors` is `false`, unless you're compiling as a custom element.
```
console.log(app.count);
app.count += 1;
```
### Custom element API
Svelte components can also be compiled to custom elements (aka web components) using the `customElement: true` compiler option. You should specify a tag name for the component using the `<svelte:options>` [element](../docs#template-syntax-svelte-options).
```
<svelte:options tag="my-element" />
<script>
export let name = 'world';
</script>
<h1>Hello {name}!</h1>
<slot></slot>
```
Alternatively, use `tag={null}` to indicate that the consumer of the custom element should name it.
```
import MyElement from './MyElement.svelte';
customElements.define('my-element', MyElement);
```
Once a custom element has been defined, it can be used as a regular DOM element:
```
document.body.innerHTML = `
<my-element>
<p>This is some slotted content</p>
</my-element>
`;
```
By default, custom elements are compiled with `accessors: true`, which means that any [props](../docs#template-syntax-attributes-and-props) are exposed as properties of the DOM element (as well as being readable/writable as attributes, where possible).
To prevent this, add `accessors={false}` to `<svelte:options>`.
```
const el = document.querySelector('my-element');
// get the current value of the 'name' prop
console.log(el.name);
// set a new value, updating the shadow DOM
el.name = 'everybody';
```
Custom elements can be a useful way to package components for consumption in a non-Svelte app, as they will work with vanilla HTML and JavaScript as well as [most frameworks](https://custom-elements-everywhere.com/). There are, however, some important differences to be aware of:
* Styles are *encapsulated*, rather than merely *scoped*. This means that any non-component styles (such as you might have in a `global.css` file) will not apply to the custom element, including styles with the `:global(...)` modifier
* Instead of being extracted out as a separate .css file, styles are inlined into the component as a JavaScript string
* Custom elements are not generally suitable for server-side rendering, as the shadow DOM is invisible until JavaScript loads
* In Svelte, slotted content renders *lazily*. In the DOM, it renders *eagerly*. In other words, it will always be created even if the component's `<slot>` element is inside an `{#if ...}` block. Similarly, including a `<slot>` in an `{#each ...}` block will not cause the slotted content to be rendered multiple times
* The `let:` directive has no effect
* Polyfills are required to support older browsers
### Server-side component API
```
const result = Component.render(...)
```
Unlike client-side components, server-side components don't have a lifespan after you render them — their whole job is to create some HTML and CSS. For that reason, the API is somewhat different.
A server-side component exposes a `render` method that can be called with optional props. It returns an object with `head`, `html`, and `css` properties, where `head` contains the contents of any `<svelte:head>` elements encountered.
You can import a Svelte component directly into Node using [`svelte/register`](../docs#run-time-svelte-register).
```
require('svelte/register');
const App = require('./App.svelte').default;
const { head, html, css } = App.render({
answer: 42
});
```
The `.render()` method accepts the following parameters:
| parameter | default | description |
| --- | --- | --- |
| `props` | `{}` | An object of properties to supply to the component |
| `options` | `{}` | An object of options |
The `options` object takes in the following options:
| option | default | description |
| --- | --- | --- |
| `context` | `new Map()` | A `Map` of root-level context key-value pairs to supply to the component |
```
const { head, html, css } = App.render(
// props
{ answer: 42 },
// options
{
context: new Map([['context-key', 'context-value']])
}
);
```
Compile time
------------
Typically, you won't interact with the Svelte compiler directly, but will instead integrate it into your build system using a bundler plugin. The bundler plugin that the Svelte team most recommends and invests in is [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte). The [SvelteKit](https://kit.svelte.dev/) framework provides a setup leveraging `vite-plugin-svelte` to build applications as well as a [tool for packaging Svelte component libraries](https://kit.svelte.dev/docs/packaging). Svelte Society maintains a list of [other bundler plugins](https://sveltesociety.dev/tools/#bundling) for additional tools like Rollup and Webpack.
Nonetheless, it's useful to understand how to use the compiler, since bundler plugins generally expose compiler options to you.
### `svelte.compile`
```
result: {
js,
css,
ast,
warnings,
vars,
stats
} = svelte.compile(source: string, options?: {...})
```
This is where the magic happens. `svelte.compile` takes your component source code, and turns it into a JavaScript module that exports a class.
```
const svelte = require('svelte/compiler');
const result = svelte.compile(source, {
// options
});
```
The following options can be passed to the compiler. None are required:
| option | default | description |
| --- | --- | --- |
| `filename` | `null` | `string` used for debugging hints and sourcemaps. Your bundler plugin will set it automatically. |
| `name` | `"Component"` | `string` that sets the name of the resulting JavaScript class (though the compiler will rename it if it would otherwise conflict with other variables in scope). It will normally be inferred from `filename`. |
| `format` | `"esm"` | If `"esm"`, creates a JavaScript module (with `import` and `export`). If `"cjs"`, creates a CommonJS module (with `require` and `module.exports`), which is useful in some server-side rendering situations or for testing. |
| `generate` | `"dom"` | If `"dom"`, Svelte emits a JavaScript class for mounting to the DOM. If `"ssr"`, Svelte emits an object with a `render` method suitable for server-side rendering. If `false`, no JavaScript or CSS is returned; just metadata. |
| `errorMode` | `"throw"` | If `"throw"`, Svelte throws when a compilation error occurred. If `"warn"`, Svelte will treat errors as warnings and add them to the warning report. |
| `varsReport` | `"strict"` | If `"strict"`, Svelte returns a variables report with only variables that are not globals nor internals. If `"full"`, Svelte returns a variables report with all detected variables. If `false`, no variables report is returned. |
| `dev` | `false` | If `true`, causes extra code to be added to components that will perform runtime checks and provide debugging information during development. |
| `immutable` | `false` | If `true`, tells the compiler that you promise not to mutate any objects. This allows it to be less conservative about checking whether values have changed. |
| `hydratable` | `false` | If `true` when generating DOM code, enables the `hydrate: true` runtime option, which allows a component to upgrade existing DOM rather than creating new DOM from scratch. When generating SSR code, this adds markers to `<head>` elements so that hydration knows which to replace. |
| `legacy` | `false` | If `true`, generates code that will work in IE9 and IE10, which don't support things like `element.dataset`. |
| `accessors` | `false` | If `true`, getters and setters will be created for the component's props. If `false`, they will only be created for readonly exported values (i.e. those declared with `const`, `class` and `function`). If compiling with `customElement: true` this option defaults to `true`. |
| `customElement` | `false` | If `true`, tells the compiler to generate a custom element constructor instead of a regular Svelte component. |
| `tag` | `null` | A `string` that tells Svelte what tag name to register the custom element with. It must be a lowercase alphanumeric string with at least one hyphen, e.g. `"my-element"`. |
| `css` | `'injected'` | If `'injected'` (formerly `true`), styles will be included in the JavaScript class and injected at runtime for the components actually rendered. If `'external'` (formerly `false`), the CSS will be returned in the `css` field of the compilation result. Most Svelte bundler plugins will set this to `'external'` and use the CSS that is statically generated for better performance, as it will result in smaller JavaScript bundles and the output can be served as cacheable `.css` files. If `'none'`, styles are completely avoided and no CSS output is generated. |
| `cssHash` | See right | A function that takes a `{ hash, css, name, filename }` argument and returns the string that is used as a classname for scoped CSS. It defaults to returning `svelte-${hash(css)}` |
| `loopGuardTimeout` | 0 | A `number` that tells Svelte to break the loop if it blocks the thread for more than `loopGuardTimeout` ms. This is useful to prevent infinite loops. **Only available when `dev: true`** |
| `preserveComments` | `false` | If `true`, your HTML comments will be preserved during server-side rendering. By default, they are stripped out. |
| `preserveWhitespace` | `false` | If `true`, whitespace inside and between elements is kept as you typed it, rather than removed or collapsed to a single space where possible. |
| `sourcemap` | `object | string` | An initial sourcemap that will be merged into the final output sourcemap. This is usually the preprocessor sourcemap. |
| `enableSourcemap` | `boolean | { js: boolean; css: boolean; }` | If `true`, Svelte generate sourcemaps for components. Use an object with `js` or `css` for more granular control of sourcemap generation. By default, this is `true`. |
| `outputFilename` | `null` | A `string` used for your JavaScript sourcemap. |
| `cssOutputFilename` | `null` | A `string` used for your CSS sourcemap. |
| `sveltePath` | `"svelte"` | The location of the `svelte` package. Any imports from `svelte` or `svelte/[module]` will be modified accordingly. |
| `namespace` | `"html"` | The namespace of the element; e.g., `"mathml"`, `"svg"`, `"foreign"`. |
The returned `result` object contains the code for your component, along with useful bits of metadata.
```
const {
js,
css,
ast,
warnings,
vars,
stats
} = svelte.compile(source);
```
* `js` and `css` are objects with the following properties:
+ `code` is a JavaScript string
+ `map` is a sourcemap with additional `toString()` and `toUrl()` convenience methods
* `ast` is an abstract syntax tree representing the structure of your component.
* `warnings` is an array of warning objects that were generated during compilation. Each warning has several properties:
+ `code` is a string identifying the category of warning
+ `message` describes the issue in human-readable terms
+ `start` and `end`, if the warning relates to a specific location, are objects with `line`, `column` and `character` properties
+ `frame`, if applicable, is a string highlighting the offending code with line numbers
* `vars` is an array of the component's declarations, used by [eslint-plugin-svelte3](https://github.com/sveltejs/eslint-plugin-svelte3) for example. Each variable has several properties:
+ `name` is self-explanatory
+ `export_name` is the name the value is exported as, if it is exported (will match `name` unless you do `export...as`)
+ `injected` is `true` if the declaration is injected by Svelte, rather than in the code you wrote
+ `module` is `true` if the value is declared in a `context="module"` script
+ `mutated` is `true` if the value's properties are assigned to inside the component
+ `reassigned` is `true` if the value is reassigned inside the component
+ `referenced` is `true` if the value is used in the template
+ `referenced_from_script` is `true` if the value is used in the `<script>` outside the declaration
+ `writable` is `true` if the value was declared with `let` or `var` (but not `const`, `class` or `function`)
* `stats` is an object used by the Svelte developer team for diagnosing the compiler. Avoid relying on it to stay the same!
### `svelte.parse`
```
ast: object = svelte.parse(
source: string,
options?: {
filename?: string,
customElement?: boolean
}
)
```
The `parse` function parses a component, returning only its abstract syntax tree. Unlike compiling with the `generate: false` option, this will not perform any validation or other analysis of the component beyond parsing it. Note that the returned AST is not considered public API, so breaking changes could occur at any point in time.
```
const svelte = require('svelte/compiler');
const ast = svelte.parse(source, { filename: 'App.svelte' });
```
### `svelte.preprocess`
A number of [community-maintained preprocessing plugins](https://sveltesociety.dev/tools#preprocessors) are available to allow you to use Svelte with tools like TypeScript, PostCSS, SCSS, and Less.
You can write your own preprocessor using the `svelte.preprocess` API.
```
result: {
code: string,
dependencies: Array<string>
} = await svelte.preprocess(
source: string,
preprocessors: Array<{
markup?: (input: { content: string, filename: string }) => Promise<{
code: string,
dependencies?: Array<string>
}>,
script?: (input: { content: string, markup: string, attributes: Record<string, string>, filename: string }) => Promise<{
code: string,
dependencies?: Array<string>
}>,
style?: (input: { content: string, markup: string, attributes: Record<string, string>, filename: string }) => Promise<{
code: string,
dependencies?: Array<string>
}>
}>,
options?: {
filename?: string
}
)
```
The `preprocess` function provides convenient hooks for arbitrarily transforming component source code. For example, it can be used to convert a `<style lang="sass">` block into vanilla CSS.
The first argument is the component source code. The second is an array of *preprocessors* (or a single preprocessor, if you only have one), where a preprocessor is an object with `markup`, `script` and `style` functions, each of which is optional.
Each `markup`, `script` or `style` function must return an object (or a Promise that resolves to an object) with a `code` property, representing the transformed source code, and an optional array of `dependencies`.
The `markup` function receives the entire component source text, along with the component's `filename` if it was specified in the third argument.
> Preprocessor functions should additionally return a `map` object alongside `code` and `dependencies`, where `map` is a sourcemap representing the transformation.
>
>
```
const svelte = require('svelte/compiler');
const MagicString = require('magic-string');
const { code } = await svelte.preprocess(source, {
markup: ({ content, filename }) => {
const pos = content.indexOf('foo');
if(pos < 0) {
return { code: content }
}
const s = new MagicString(content, { filename })
s.overwrite(pos, pos + 3, 'bar', { storeName: true })
return {
code: s.toString(),
map: s.generateMap()
}
}
}, {
filename: 'App.svelte'
});
```
The `script` and `style` functions receive the contents of `<script>` and `<style>` elements respectively (`content`) as well as the entire component source text (`markup`). In addition to `filename`, they get an object of the element's attributes.
If a `dependencies` array is returned, it will be included in the result object. This is used by packages like [rollup-plugin-svelte](https://github.com/sveltejs/rollup-plugin-svelte) to watch additional files for changes, in the case where your `<style>` tag has an `@import` (for example).
```
const svelte = require('svelte/compiler');
const sass = require('node-sass');
const { dirname } = require('path');
const { code, dependencies } = await svelte.preprocess(source, {
style: async ({ content, attributes, filename }) => {
// only process <style lang="sass">
if (attributes.lang !== 'sass') return;
const { css, stats } = await new Promise((resolve, reject) => sass.render({
file: filename,
data: content,
includePaths: [
dirname(filename),
],
}, (err, result) => {
if (err) reject(err);
else resolve(result);
}));
return {
code: css.toString(),
dependencies: stats.includedFiles
};
}
}, {
filename: 'App.svelte'
});
```
Multiple preprocessors can be used together. The output of the first becomes the input to the second. `markup` functions run first, then `script` and `style`.
```
const svelte = require('svelte/compiler');
const { code } = await svelte.preprocess(source, [
{
markup: () => {
console.log('this runs first');
},
script: () => {
console.log('this runs third');
},
style: () => {
console.log('this runs fifth');
}
},
{
markup: () => {
console.log('this runs second');
},
script: () => {
console.log('this runs fourth');
},
style: () => {
console.log('this runs sixth');
}
}
], {
filename: 'App.svelte'
});
```
### `svelte.walk`
```
walk(ast: Node, {
enter(node: Node, parent: Node, prop: string, index: number)?: void,
leave(node: Node, parent: Node, prop: string, index: number)?: void
})
```
The `walk` function provides a way to walk the abstract syntax trees generated by the parser, using the compiler's own built-in instance of [estree-walker](https://github.com/Rich-Harris/estree-walker).
The walker takes an abstract syntax tree to walk and an object with two optional methods: `enter` and `leave`. For each node, `enter` is called (if present). Then, unless `this.skip()` is called during `enter`, each of the children are traversed, and then `leave` is called on the node.
```
const svelte = require('svelte/compiler');
svelte.walk(ast, {
enter(node, parent, prop, index) {
do\_something(node);
if (should\_skip\_children(node)) {
this.skip();
}
},
leave(node, parent, prop, index) {
do\_something\_else(node);
}
});
```
### `svelte.VERSION`
The current version, as set in package.json.
```
const svelte = require('svelte/compiler');
console.log(`running svelte version ${svelte.VERSION}`);
```
Accessibility warnings
----------------------
Accessibility (shortened to a11y) isn't always easy to get right, but Svelte will help by warning you at compile time if you write inaccessible markup. However, keep in mind that many accessibility issues can only be identified at runtime using other automated tools and by manually testing your application.
Here is a list of accessibility checks Svelte will do for you.
### `a11y-accesskey`
Enforce no `accesskey` on element. Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screen reader and keyboard-only users create accessibility complications. To avoid complications, access keys should not be used.
```
<!-- A11y: Avoid using accesskey -->
<div accessKey='z'></div>
```
### `a11y-aria-attributes`
Certain reserved DOM elements do not support ARIA roles, states and properties. This is often because they are not visible, for example `meta`, `html`, `script`, `style`. This rule enforces that these DOM elements do not contain the `aria-*` props.
```
<!-- A11y: <meta> should not have aria-\* attributes -->
<meta aria-hidden="false">
```
### `a11y-autofocus`
Enforce that `autofocus` is not used on elements. Autofocusing elements can cause usability issues for sighted and non-sighted users alike.
```
<!-- A11y: Avoid using autofocus -->
<input autofocus>
```
### `a11y-click-events-have-key-events`
Enforce `on:click` is accompanied by at least one of the following: `onKeyUp`, `onKeyDown`, `onKeyPress`. Coding for the keyboard is important for users with physical disabilities who cannot use a mouse, AT compatibility, and screenreader users.
This does not apply for interactive or hidden elements.
```
<!-- A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event. -->
<div on:click={() => {}} />
```
### `a11y-distracting-elements`
Enforces that no distracting elements are used. Elements that can be visually distracting can cause accessibility issues with visually impaired users. Such elements are most likely deprecated, and should be avoided.
The following elements are visually distracting: `<marquee>` and `<blink>`.
```
<!-- A11y: Avoid <marquee> elements -->
<marquee />
```
### `a11y-hidden`
Certain DOM elements are useful for screen reader navigation and should not be hidden.
```
<!-- A11y: <h2> element should not be hidden -->
<h2 aria-hidden="true">invisible header</h2>
```
### `a11y-img-redundant-alt`
Enforce img alt attribute does not contain the word image, picture, or photo. Screen readers already announce `img` elements as an image. There is no need to use words such as *image*, *photo*, and/or *picture*.
```
<img src="foo" alt="Foo eating a sandwich." />
<!-- aria-hidden, won't be announced by screen reader -->
<img src="bar" aria-hidden="true" alt="Picture of me taking a photo of an image" />
<!-- A11y: Screen readers already announce <img> elements as an image. -->
<img src="foo" alt="Photo of foo being weird." />
<!-- A11y: Screen readers already announce <img> elements as an image. -->
<img src="bar" alt="Image of me at a bar!" />
<!-- A11y: Screen readers already announce <img> elements as an image. -->
<img src="foo" alt="Picture of baz fixing a bug." />
```
### `a11y-incorrect-aria-attribute-type`
Enforce that only the correct type of value is used for aria attributes. For example, `aria-hidden` should only receive a boolean.
```
<!-- A11y: The value of 'aria-hidden' must be exactly one of true or false -->
<div aria-hidden="yes"/>
```
### `a11y-invalid-attribute`
Enforce that attributes important for accessibility have a valid value. For example, `href` should not be empty, `'#'`, or `javascript:`.
```
<!-- A11y: '' is not a valid href attribute -->
<a href=''>invalid</a>
```
### `a11y-label-has-associated-control`
Enforce that a label tag has a text label and an associated control.
There are two supported ways to associate a label with a control:
* Wrapping a control in a label tag.
* Adding `for` to a label and assigning it the ID of an input on the page.
```
<label for="id">B</label>
<label>C <input type="text" /></label>
<!-- A11y: A form label must be associated with a control. -->
<label>A</label>
```
### `a11y-media-has-caption`
Providing captions for media is essential for deaf users to follow along. Captions should be a transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information. Not only is this important for accessibility, but can also be useful for all users in the case that the media is unavailable (similar to `alt` text on an image when an image is unable to load).
The captions should contain all important and relevant information to understand the corresponding media. This may mean that the captions are not a 1:1 mapping of the dialogue in the media content. However, captions are not necessary for video components with the `muted` attribute.
```
<video><track kind="captions"/></video>
<audio muted></audio>
<!-- A11y: Media elements must have a <track kind=\"captions\"> -->
<video></video>
<!-- A11y: Media elements must have a <track kind=\"captions\"> -->
<video><track /></video>
```
### `a11y-misplaced-role`
Certain reserved DOM elements do not support ARIA roles, states and properties. This is often because they are not visible, for example `meta`, `html`, `script`, `style`. This rule enforces that these DOM elements do not contain the `role` props.
```
<!-- A11y: <meta> should not have role attribute -->
<meta role="tooltip">
```
### `a11y-misplaced-scope`
The scope attribute should only be used on `<th>` elements.
```
<!-- A11y: The scope attribute should only be used with <th> elements -->
<div scope="row" />
```
### `a11y-missing-attribute`
Enforce that attributes required for accessibility are present on an element. This includes the following checks:
* `<a>` should have an href (unless it's a [fragment-defining tag](https://github.com/sveltejs/svelte/issues/4697))
* `<area>` should have alt, aria-label, or aria-labelledby
* `<html>` should have lang
* `<iframe>` should have title
* `<img>` should have alt
* `<object>` should have title, aria-label, or aria-labelledby
* `<input type="image">` should have alt, aria-label, or aria-labelledby
```
<!-- A11y: <input type=\"image\"> element should have an alt, aria-label or aria-labelledby attribute -->
<input type="image">
<!-- A11y: <html> element should have a lang attribute -->
<html></html>
<!-- A11y: <a> element should have an href attribute -->
<a>text</a>
```
### `a11y-missing-content`
Enforce that heading elements (`h1`, `h2`, etc.) and anchors have content and that the content is accessible to screen readers
```
<!-- A11y: <a> element should have child content -->
<a href='/foo'></a>
<!-- A11y: <h1> element should have child content -->
<h1></h1>
```
### `a11y-mouse-events-have-key-events`
Enforce that `on:mouseover` and `on:mouseout` are accompanied by `on:focus` and `on:blur`, respectively. This helps to ensure that any functionality triggered by these mouse events is also accessible to keyboard users.
```
<!-- A11y: on:mouseover must be accompanied by on:focus -->
<div on:mouseover={handleMouseover} />
<!-- A11y: on:mouseout must be accompanied by on:blur -->
<div on:mouseout={handleMouseout} />
```
### `a11y-no-redundant-roles`
Some HTML elements have default ARIA roles. Giving these elements an ARIA role that is already set by the browser [has no effect](https://www.w3.org/TR/using-aria/#aria-does-nothing) and is redundant.
```
<!-- A11y: Redundant role 'button' -->
<button role="button" />
<!-- A11y: Redundant role 'img' -->
<img role="img" src="foo.jpg" />
```
### `a11y-no-interactive-element-to-noninteractive-role`
[WAI-ARIA](https://www.w3.org/TR/wai-aria-1.1/#usage_intro) roles should not be used to convert an interactive element to a non-interactive element. Non-interactive ARIA roles include `article`, `banner`, `complementary`, `img`, `listitem`, `main`, `region` and `tooltip`.
```
<!-- A11y: <textarea> cannot have role 'listitem' -->
<textarea role="listitem" />
```
### `a11y-no-noninteractive-tabindex`
Tab key navigation should be limited to elements on the page that can be interacted with.
```
<!-- A11y: noninteractive element cannot have nonnegative tabIndex value -->
<div tabindex='0' />
```
### `a11y-positive-tabindex`
Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users.
```
<!-- A11y: avoid tabindex values above zero -->
<div tabindex='1'/>
```
### `a11y-role-has-required-aria-props`
Elements with ARIA roles must have all required attributes for that role.
```
<!-- A11y: A11y: Elements with the ARIA role "checkbox" must have the following attributes defined: "aria-checked" -->
<span role="checkbox" aria-labelledby="foo" tabindex="0"></span>
```
### `a11y-structure`
Enforce that certain DOM elements have the correct structure.
```
<!-- A11y: <figcaption> must be an immediate child of <figure> -->
<div>
<figcaption>Image caption</figcaption>
</div>
```
### `a11y-unknown-aria-attribute`
Enforce that only known ARIA attributes are used. This is based on the [WAI-ARIA States and Properties spec](https://www.w3.org/WAI/PF/aria-1.1/states_and_properties).
```
<!-- A11y: Unknown aria attribute 'aria-labeledby' (did you mean 'labelledby'?) -->
<input type="image" aria-labeledby="foo">
```
### `a11y-unknown-role`
Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to role definitions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/#role_definitions) site.
```
<!-- A11y: Unknown role 'toooltip' (did you mean 'tooltip'?) -->
<div role="toooltip"></div>
```
| programming_docs |
minitest Minitest Minitest
========
* [History](https://docs.seattlerb.org/minitest/History_rdoc.html)
* [Manifest](manifest_txt)
* [README](https://docs.seattlerb.org/minitest/README_rdoc.html)
* [Kernel](kernel)
* [Minitest](minitest)
* [Minitest::AbstractReporter](minitest/abstractreporter)
* [Minitest::Assertion](minitest/assertion)
* [Minitest::Assertions](minitest/assertions)
* [Minitest::BacktraceFilter](minitest/backtracefilter)
* [Minitest::BenchSpec](minitest/benchspec)
* [Minitest::Benchmark](minitest/benchmark)
* [Minitest::CompositeReporter](minitest/compositereporter)
* [Minitest::Expectations](minitest/expectations)
* [Minitest::Guard](minitest/guard)
* [Minitest::Mock](minitest/mock)
* [Minitest::Parallel](minitest/parallel)
* [Minitest::Parallel::Executor](minitest/parallel/executor)
* [Minitest::PrideIO](minitest/prideio)
* [Minitest::PrideLOL](minitest/pridelol)
* [Minitest::ProgressReporter](minitest/progressreporter)
* [Minitest::Reportable](minitest/reportable)
* [Minitest::Result](minitest/result)
* [Minitest::Skip](minitest/skip)
* [Minitest::Spec](minitest/spec)
* [Minitest::Spec::DSL](minitest/spec/dsl)
* [Minitest::Spec::DSL::InstanceMethods](minitest/spec/dsl/instancemethods)
* [Minitest::StatisticsReporter](minitest/statisticsreporter)
* [Minitest::SummaryReporter](minitest/summaryreporter)
* [Minitest::Test](minitest/test)
* [Minitest::Test::LifecycleHooks](minitest/test/lifecyclehooks)
* [Minitest::TestTask](minitest/testtask)
* [Minitest::UnexpectedError](minitest/unexpectederror)
* [Object](object)
minitest class Object class Object
=============
Parent:
BasicObject
[`Object`](object) extensions for [`Minitest::Mock`](minitest/mock).
stub(name, val\_or\_callable, \*block\_args, \*\*block\_kwargs, &block) Show source
```
# File lib/minitest/mock.rb, line 278
def stub name, val_or_callable, *block_args, **block_kwargs, &block
new_name = "__minitest_stub__#{name}"
metaclass = class << self; self; end
if respond_to? name and not methods.map(&:to_s).include? name.to_s then
metaclass.send :define_method, name do |*args, **kwargs|
super(*args, **kwargs)
end
end
metaclass.send :alias_method, new_name, name
if ENV["MT_KWARGS_HAC\K"] then
metaclass.send :define_method, name do |*args, &blk|
if val_or_callable.respond_to? :call then
val_or_callable.call(*args, &blk)
else
blk.call(*block_args, **block_kwargs) if blk
val_or_callable
end
end
else
metaclass.send :define_method, name do |*args, **kwargs, &blk|
if val_or_callable.respond_to? :call then
if kwargs.empty? then # FIX: drop this after 2.7 dead
val_or_callable.call(*args, &blk)
else
val_or_callable.call(*args, **kwargs, &blk)
end
else
if blk then
if block_kwargs.empty? then # FIX: drop this after 2.7 dead
blk.call(*block_args)
else
blk.call(*block_args, **block_kwargs)
end
end
val_or_callable
end
end
end
block[self]
ensure
metaclass.send :undef_method, name
metaclass.send :alias_method, name, new_name
metaclass.send :undef_method, new_name
end
```
Add a temporary stubbed method replacing `name` for the duration of the `block`. If `val_or_callable` responds to call, then it returns the result of calling it, otherwise returns the value as-is. If stubbed method yields a block, `block_args` will be passed along. Cleans up the stub at the end of the `block`. The method `name` must exist before stubbing.
```
def test_stale_eh
obj_under_test = Something.new
refute obj_under_test.stale?
Time.stub :now, Time.at(0) do
assert obj_under_test.stale?
end
end
```
Calls superclass method
minitest module Kernel module Kernel
==============
[`Kernel`](kernel) extensions for minitest
describe(desc, \*additional\_desc, &block) Show source
```
# File lib/minitest/spec.rb, line 82
def describe desc, *additional_desc, &block # :doc:
stack = Minitest::Spec.describe_stack
name = [stack.last, desc, *additional_desc].compact.join("::")
sclas = stack.last || if Class === self && kind_of?(Minitest::Spec::DSL) then
self
else
Minitest::Spec.spec_type desc, *additional_desc
end
cls = sclas.create name, desc
stack.push cls
cls.class_eval(&block)
stack.pop
cls
end
```
Describe a series of expectations for a given target `desc`.
Defines a test class subclassing from either [`Minitest::Spec`](minitest/spec) or from the surrounding describe’s class. The surrounding class may subclass [`Minitest::Spec`](minitest/spec) manually in order to easily share code:
```
class MySpec < Minitest::Spec
# ... shared code ...
end
class TestStuff < MySpec
it "does stuff" do
# shared code available here
end
describe "inner stuff" do
it "still does stuff" do
# ...and here
end
end
end
```
For more information on getting started with writing specs, see:
[www.rubyinside.com/a-minitestspec-tutorial-elegant-spec-style-testing-that-comes-with-ruby-5354.html](http://www.rubyinside.com/a-minitestspec-tutorial-elegant-spec-style-testing-that-comes-with-ruby-5354.html)
For some suggestions on how to improve your specs, try:
[betterspecs.org](https://betterspecs.org)
but do note that several items there are debatable or specific to rspec.
For more information about expectations, see [`Minitest::Expectations`](minitest/expectations).
minitest module Minitest module Minitest
================
minitest/{test,spec,mock,benchmark}
===================================
home
[github.com/seattlerb/minitest](https://github.com/seattlerb/minitest)
bugs
[github.com/seattlerb/minitest/issues](https://github.com/seattlerb/minitest/issues)
rdoc
[docs.seattlerb.org/minitest](https://docs.seattlerb.org/minitest)
vim
[github.com/sunaku/vim-ruby-minitest](https://github.com/sunaku/vim-ruby-minitest)
emacs
[github.com/arthurnn/minitest-emacs](https://github.com/arthurnn/minitest-emacs)
DESCRIPTION:
------------
minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
```
"I had a class with Jim Weirich on testing last week and we were
allowed to choose our testing frameworks. Kirk Haines and I were
paired up and we cracked open the code for a few test
frameworks...
I MUST say that minitest is *very* readable / understandable
compared to the 'other two' options we looked at. Nicely done and
thank you for helping us keep our mental sanity."
-- Wayne E. Seguin
```
minitest/test is a small and incredibly fast unit testing framework. It provides a rich set of assertions to make your tests clean and readable.
minitest/spec is a functionally complete spec engine. It hooks onto minitest/test and seamlessly bridges test assertions over to spec expectations.
minitest/benchmark is an awesome way to assert the performance of your algorithms in a repeatable manner. Now you can assert that your newb co-worker doesn’t replace your linear algorithm with an exponential one!
minitest/mock by Steven Baker, is a beautifully tiny mock (and stub) object framework.
minitest/pride shows pride in testing and adds coloring to your test output. I guess it is an example of how to write IO pipes too. :P
minitest/test is meant to have a clean implementation for language implementors that need a minimal set of methods to bootstrap a working test suite. For example, there is no magic involved for test-case discovery.
```
"Again, I can't praise enough the idea of a testing/specing
framework that I can actually read in full in one sitting!"
-- Piotr Szotkowski
```
Comparing to rspec:
```
rspec is a testing DSL. minitest is ruby.
-- Adam Hawkins, "Bow Before MiniTest"
```
minitest doesn’t reinvent anything that ruby already provides, like: classes, modules, inheritance, methods. This means you only have to learn ruby to use minitest and all of your regular OO practices like extract-method refactorings still apply.
FEATURES/PROBLEMS:
------------------
* minitest/autorun - the easy and explicit way to run all your tests.
* minitest/test - a very fast, simple, and clean test system.
* minitest/spec - a very fast, simple, and clean spec system.
* minitest/mock - a simple and clean mock/stub system.
* minitest/benchmark - an awesome way to assert your algorithm’s performance.
* minitest/pride - show your pride in testing!
* minitest/test\_task - a full-featured and clean rake task generator.
* Incredibly small and fast runner, but no bells and whistles.
* Written by squishy human beings. Software can never be perfect. We will all eventually die.
RATIONALE:
----------
See design\_rationale.rb to see how specs and tests work in minitest.
SYNOPSIS:
---------
Given that you’d like to test the following class:
```
class Meme
def i_can_has_cheezburger?
"OHAI!"
end
def will_it_blend?
"YES!"
end
end
```
### Unit tests
Define your tests as methods beginning with `test_`.
```
require "minitest/autorun"
class TestMeme < Minitest::Test
def setup
@meme = Meme.new
end
def test_that_kitty_can_eat
assert_equal "OHAI!", @meme.i_can_has_cheezburger?
end
def test_that_it_will_not_blend
refute_match /^no/i, @meme.will_it_blend?
end
def test_that_will_be_skipped
skip "test this later"
end
end
```
### Specs
```
require "minitest/autorun"
describe Meme do
before do
@meme = Meme.new
end
describe "when asked about cheeseburgers" do
it "must respond positively" do
_(@meme.i_can_has_cheezburger?).must_equal "OHAI!"
end
end
describe "when asked about blending possibilities" do
it "won't say no" do
_(@meme.will_it_blend?).wont_match /^no/i
end
end
end
```
For matchers support check out:
* [github.com/wojtekmach/minitest-matchers](https://github.com/wojtekmach/minitest-matchers)
* [github.com/rmm5t/minitest-matchers\_vaccine](https://github.com/rmm5t/minitest-matchers_vaccine)
### Benchmarks
Add benchmarks to your tests.
```
# optionally run benchmarks, good for CI-only work!
require "minitest/benchmark" if ENV["BENCH"]
class TestMeme < Minitest::Benchmark
# Override self.bench_range or default range is [1, 10, 100, 1_000, 10_000]
def bench_my_algorithm
assert_performance_linear 0.9999 do |n| # n is a range value
@obj.my_algorithm(n)
end
end
end
```
Or add them to your specs. If you make benchmarks optional, you’ll need to wrap your benchmarks in a conditional since the methods won’t be defined. In minitest 5, the describe name needs to match `/Bench(mark)?$/`.
```
describe "Meme Benchmark" do
if ENV["BENCH"] then
bench_performance_linear "my_algorithm", 0.9999 do |n|
100.times do
@obj.my_algorithm(n)
end
end
end
end
```
outputs something like:
```
# Running benchmarks:
TestBlah 100 1000 10000
bench_my_algorithm 0.006167 0.079279 0.786993
bench_other_algorithm 0.061679 0.792797 7.869932
```
Output is tab-delimited to make it easy to paste into a spreadsheet.
### Mocks
Mocks and stubs defined using terminology by Fowler & Meszaros at [www.martinfowler.com/bliki/TestDouble.html](https://www.martinfowler.com/bliki/TestDouble.html):
“Mocks are pre-programmed with expectations which form a specification of the calls they are expected to receive. They can throw an exception if they receive a call they don’t expect and are checked during verification to ensure they got all the calls they were expecting.”
```
class MemeAsker
def initialize(meme)
@meme = meme
end
def ask(question)
method = question.tr(" ", "_") + "?"
@meme.__send__(method)
end
end
require "minitest/autorun"
describe MemeAsker, :ask do
describe "when passed an unpunctuated question" do
it "should invoke the appropriate predicate method on the meme" do
@meme = Minitest::Mock.new
@meme_asker = MemeAsker.new @meme
@meme.expect :will_it_blend?, :return_value
@meme_asker.ask "will it blend"
@meme.verify
end
end
end
```
#### Multi-threading and Mocks
[`Minitest`](minitest) mocks do not support multi-threading. If it works, fine, if it doesn’t you can use regular ruby patterns and facilities like local variables. Here’s an example of asserting that code inside a thread is run:
```
def test_called_inside_thread
called = false
pr = Proc.new { called = true }
thread = Thread.new(&pr)
thread.join
assert called, "proc not called"
end
```
### Stubs
Mocks and stubs are defined using terminology by Fowler & Meszaros at [www.martinfowler.com/bliki/TestDouble.html](https://www.martinfowler.com/bliki/TestDouble.html):
“Stubs provide canned answers to calls made during the test”.
Minitest’s stub method overrides a single method for the duration of the block.
```
def test_stale_eh
obj_under_test = Something.new
refute obj_under_test.stale?
Time.stub :now, Time.at(0) do # stub goes away once the block is done
assert obj_under_test.stale?
end
end
```
A note on stubbing: In order to stub a method, the method must actually exist prior to stubbing. Use a singleton method to create a new non-existing method:
```
def obj_under_test.fake_method
...
end
```
### Running Your Tests
Ideally, you’ll use a rake task to run your tests (see below), either piecemeal or all at once. BUT! You don’t have to:
```
% ruby -Ilib:test test/minitest/test_minitest_test.rb
Run options: --seed 37685
# Running:
...................................................................... (etc)
Finished in 0.107130s, 1446.8403 runs/s, 2959.0217 assertions/s.
155 runs, 317 assertions, 0 failures, 0 errors, 0 skips
```
There are runtime options available, both from minitest itself, and also provided via plugins. To see them, simply run with `--help`:
```
% ruby -Ilib:test test/minitest/test_minitest_test.rb --help
minitest options:
-h, --help Display this help.
-s, --seed SEED Sets random seed. Also via env. Eg: SEED=n rake
-v, --verbose Verbose. Show progress processing files.
-n, --name PATTERN Filter run on /regexp/ or string.
-e, --exclude PATTERN Exclude /regexp/ or string from run.
Known extensions: pride, autotest
-p, --pride Pride. Show your testing pride!
-a, --autotest Connect to autotest server.
```
### Rake Tasks
You can set up a rake task to run all your tests by adding this to your Rakefile:
```
require "minitest/test_task"
Minitest::TestTask.create # named test, sensible defaults
# or more explicitly:
Minitest::TestTask.create(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.warning = false
t.test_globs = ["test/**/*_test.rb"]
end
task :default => :test
```
Each of these will generate 4 tasks:
```
rake test :: Run the test suite.
rake test:cmd :: Print out the test command.
rake test:isolated :: Show which test files fail when run separately.
rake test:slow :: Show bottom 25 tests sorted by time.
```
### Rake Task Variables
There are a bunch of variables you can supply to rake to modify the run.
```
MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs.
N :: -n: Tests to run (string or /regexp/).
X :: -x: Tests to exclude (string or /regexp/).
A :: Any extra arguments. Honors shell quoting.
MT_CPU :: How many threads to use for parallel test runs
SEED :: -s --seed Sets random seed.
TESTOPTS :: Deprecated, same as A
FILTER :: Deprecated, same as A
```
Writing Extensions
------------------
To define a plugin, add a file named minitest/XXX\_plugin.rb to your project/gem. That file must be discoverable via ruby’s LOAD\_PATH (via rubygems or otherwise). [`Minitest`](minitest) will find and require that file using Gem.find\_files. It will then try to call `plugin_XXX_init` during startup. The option processor will also try to call `plugin_XXX_options` passing the OptionParser instance and the current options hash. This lets you register your own command-line options. Here’s a totally bogus example:
```
# minitest/bogus_plugin.rb:
module Minitest
def self.plugin_bogus_options(opts, options)
opts.on "--myci", "Report results to my CI" do
options[:myci] = true
options[:myci_addr] = get_myci_addr
options[:myci_port] = get_myci_port
end
end
def self.plugin_bogus_init(options)
self.reporter << MyCI.new(options) if options[:myci]
end
end
```
### Adding custom reporters
[`Minitest`](minitest) uses composite reporter to output test results using multiple reporter instances. You can add new reporters to the composite during the init\_plugins phase. As we saw in `plugin_bogus_init` above, you simply add your reporter instance to the composite via `<<`.
`AbstractReporter` defines the API for reporters. You may subclass it and override any method you want to achieve your desired behavior.
start
Called when the run has started.
record
Called for each result, passed or otherwise.
report
Called at the end of the run.
passed?
Called to see if you detected any problems.
Using our example above, here is how we might implement MyCI:
```
# minitest/bogus_plugin.rb
module Minitest
class MyCI < AbstractReporter
attr_accessor :results, :addr, :port
def initialize options
self.results = []
self.addr = options[:myci_addr]
self.port = options[:myci_port]
end
def record result
self.results << result
end
def report
CI.connect(addr, port).send_results self.results
end
end
# code from above...
end
```
FAQ
---
### What versions are compatible with what? Or what versions are supported?
[`Minitest`](minitest) is a dependency of rails, which until fairly recently had an overzealous backwards compatibility policy. As such, I’m stuck supporting versions of ruby that are long past EOL. Hopefully I’ll be able to support only current versions of ruby sometime in the near future.
(As of 2022-11-29)
Current versions of rails: ([endoflife.date/rails](https://endoflife.date/rails))
```
| rails | min ruby | rec ruby | minitest | status | EOL Date |
|-------+----------+----------+----------+----------+------------|
| 7.0 | >= 2.7 | 3.1 | >= 5.1 | Current | 2025-06-01?|
| 6.1 | >= 2.5 | 3.0 | >= 5.1 | Maint | 2024-06-01?|
| 6.0 | >= 2.5 | 2.6 | >= 5.1 | Security | 2023-06-01 |
| 5.2 | >= 2.2.2 | 2.5 | ~> 5.1 | EOL | 2022-06-01 |
```
Current versions of ruby: ([endoflife.date/ruby](https://endoflife.date/ruby))
```
| ruby | Status | EOL Date |
|------+---------+------------|
| 3.1 | Current | 2025-12-25 |
| 3.0 | Maint | 2024-03-31 |
| 2.7 | Maint* | 2023-03-31 |
| 2.6 | EOL | 2022-03-31 |
| 2.5 | EOL | 2021-03-31 |
```
See also:
* [www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html](https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html)
### How to test SimpleDelegates?
The following implementation and test:
```
class Worker < SimpleDelegator
def work
end
end
describe Worker do
before do
@worker = Worker.new(Object.new)
end
it "must respond to work" do
_(@worker).must_respond_to :work
end
end
```
outputs a failure:
```
1) Failure:
Worker#test_0001_must respond to work [bug11.rb:16]:
Expected #<Object:0x007f9e7184f0a0> (Object) to respond to #work.
```
Worker is a SimpleDelegate which in 1.9+ is a subclass of BasicObject. [`Expectations`](minitest/expectations) are put on [`Object`](object) (one level down) so the Worker (SimpleDelegate) hits `method_missing` and delegates down to the `Object.new` instance. That object doesn’t respond to work so the test fails.
You can bypass `SimpleDelegate#method_missing` by extending the worker with `Minitest::Expectations`. You can either do that in your setup at the instance level, like:
```
before do
@worker = Worker.new(Object.new)
@worker.extend Minitest::Expectations
end
```
or you can extend the Worker class (within the test file!), like:
```
class Worker
include ::Minitest::Expectations
end
```
### How to share code across test classes?
Use a module. That’s exactly what they’re for:
```
module UsefulStuff
def useful_method
# ...
end
end
describe Blah do
include UsefulStuff
def test_whatever
# useful_method available here
end
end
```
Remember, `describe` simply creates test classes. It’s just ruby at the end of the day and all your normal Good Ruby Rules (tm) apply. If you want to extend your test using setup/teardown via a module, just make sure you ALWAYS call super. before/after automatically call super for you, so make sure you don’t do it twice.
### How to run code before a group of tests?
Use a constant with begin…end like this:
```
describe Blah do
SETUP = begin
# ... this runs once when describe Blah starts
end
# ...
end
```
This can be useful for expensive initializations or sharing state. Remember, this is just ruby code, so you need to make sure this technique and sharing state doesn’t interfere with your tests.
### Why am I seeing `uninitialized constant MiniTest::Test (NameError)`?
Are you running the test with Bundler (e.g. via `bundle exec` )? If so, in order to require minitest, you must first add the `gem 'minitest'` to your Gemfile and run `bundle`. Once it’s installed, you should be able to require minitest and run your tests.
Prominent Projects using Minitest:
----------------------------------
* arel
* journey
* mime-types
* nokogiri
* rails (active\_support et al)
* rake
* rdoc
* …and of course, everything from seattle.rb…
Developing Minitest:
--------------------
[`Minitest`](minitest) requires [Hoe](https://rubygems.org/gems/hoe).
### Minitest’s own tests require UTF-8 external encoding.
This is a common problem in Windows, where the default external Encoding is often CP850, but can affect any platform. [`Minitest`](minitest) can run test suites using any Encoding, but to run Minitest’s own tests you must have a default external Encoding of UTF-8.
If your encoding is wrong, you’ll see errors like:
```
--- expected
+++ actual
@@ -1,2 +1,3 @@
# encoding: UTF-8
-"Expected /\\w+/ to not match \"blah blah blah\"."
+"Expected /\\w+/ to not match # encoding: UTF-8
+\"blah blah blah\"."
```
To check your current encoding, run:
```
ruby -e 'puts Encoding.default_external'
```
If your output is something other than UTF-8, you can set the RUBYOPTS env variable to a value of ‘-Eutf-8’. Something like:
```
RUBYOPT='-Eutf-8' ruby -e 'puts Encoding.default_external'
```
Check your OS/shell documentation for the precise syntax (the above will not work on a basic Windows CMD prompt, look for the SET command). Once you’ve got it successfully outputing UTF-8, use the same setting when running rake in [`Minitest`](minitest).
### Minitest’s own tests require GNU (or similar) diff.
This is also a problem primarily affecting Windows developers. PowerShell has a command called diff, but it is not suitable for use with [`Minitest`](minitest).
If you see failures like either of these, you are probably missing diff tool:
```
4) Failure:
TestMinitestUnitTestCase#test_assert_equal_different_long [D:/ruby/seattlerb/minitest/test/minitest/test_minitest_test.rb:936]:
Expected: "--- expected\n+++ actual\n@@ -1 +1 @@\n-\"hahahahahahahahahahahahahahahahahahahaha\"\n+\"blahblahblahblahblahblahblahblahblahblah\"\n"
Actual: "Expected: \"hahahahahahahahahahahahahahahahahahahaha\"\n Actual: \"blahblahblahblahblahblahblahblahblahblah\""
5) Failure:
TestMinitestUnitTestCase#test_assert_equal_different_collection_hash_hex_invisible [D:/ruby/seattlerb/minitest/test/minitest/test_minitest_test.rb:845]:
Expected: "No visible difference in the Hash#inspect output.\nYou should look at the implementation of #== on Hash or its members.\n
{1=>#<Object:0xXXXXXX>}"
Actual: "Expected: {1=>#<Object:0x00000003ba0470>}\n Actual: {1=>#<Object:0x00000003ba0448>}"
```
If you use Cygwin or MSYS2 or similar there are packages that include a GNU diff for Windows. If you don’t, you can download GNU diffutils from [gnuwin32.sourceforge.net/packages/diffutils.htm](http://gnuwin32.sourceforge.net/packages/diffutils.htm) (make sure to add it to your PATH).
You can make sure it’s installed and path is configured properly with:
```
diff.exe -v
```
There are multiple lines of output, the first should be something like:
```
diff (GNU diffutils) 2.8.1
```
If you are using PowerShell make sure you run diff.exe, not just diff, which will invoke the PowerShell built in function.
Known Extensions:
-----------------
capybara\_minitest\_spec
Bridge between Capybara RSpec matchers and [`Minitest::Spec`](minitest/spec) expectations (e.g. `page.must_have_content("Title")`).
color\_pound\_spec\_reporter
[`Test`](minitest/test) names print Ruby [`Object`](object) types in color with your [`Minitest`](minitest) [`Spec`](minitest/spec) style tests.
minispec-metadata
Metadata for describe/it blocks & CLI tag filter. E.g. `it "requires JS driver", js: true do` & `ruby test.rb --tag js` runs tests tagged :js.
minispec-rails
Minimal support to use [`Spec`](minitest/spec) style in Rails 5+.
mini-apivore
for swagger based automated API testing.
minitest-around
Around block for minitest. An alternative to setup/teardown dance.
minitest-assert\_errors
Adds [`Minitest`](minitest) assertions to test for errors raised or not raised by [`Minitest`](minitest) itself.
minitest-autotest
autotest is a continuous testing facility meant to be used during development.
minitest-bacon
minitest-bacon extends minitest with bacon-like functionality.
minitest-bang
Adds support for RSpec-style let! to immediately invoke let statements before each test.
minitest-bisect
Helps you isolate and debug random test failures.
minitest-blink1\_reporter
Display test results with a Blink1.
minitest-capistrano
[`Assertions`](minitest/assertions) and expectations for testing Capistrano recipes.
minitest-capybara
Capybara matchers support for minitest unit and spec.
minitest-cc
It provides minimal information about code coverage.
minitest-chef-handler
Run [`Minitest`](minitest) suites as Chef report handlers
minitest-ci
CI reporter plugin for [`Minitest`](minitest).
minitest-context
Defines contexts for code reuse in [`Minitest`](minitest) specs that share common expectations.
minitest-debugger
Wraps assert so failed assertions drop into the ruby debugger.
minitest-display
Patches [`Minitest`](minitest) to allow for an easily configurable output.
minitest-documentation
Minimal documentation format inspired by rspec’s.
minitest-doc\_reporter
Detailed output inspired by rspec’s documentation format.
minitest-emoji
Print out emoji for your test passes, fails, and skips.
minitest-english
Semantically symmetric aliases for assertions and expectations.
minitest-excludes
Clean API for excluding certain tests you don’t want to run under certain conditions.
minitest-fail-fast
Reimplements RSpec’s “fail fast” feature
minitest-filecontent
Support unit tests with expectation results in files. Differing results will be stored again in files.
minitest-filesystem
Adds assertion and expectation to help testing filesystem contents.
minitest-firemock
Makes your [`Minitest`](minitest) mocks more resilient.
minitest-focus
Focus on one test at a time.
minitest-gcstats
A minitest plugin that adds a report of the top tests by number of objects allocated.
minitest-global\_expectations
Support minitest expectation methods for all objects
minitest-great\_expectations
Generally useful additions to minitest’s assertions and expectations.
minitest-growl
[`Test`](minitest/test) notifier for minitest via growl.
minitest-happy
GLOBALLY ACTIVATE MINITEST PRIDE! RAWR!
minitest-have\_tag
Adds [`Minitest`](minitest) assertions to test for the existence of HTML tags, including contents, within a provided string.
minitest-heat
Reporting that builds a heat map of failure locations
minitest-hooks
Around and before\_all/after\_all/around\_all hooks
minitest-hyper
Pretty, single-page HTML reports for your [`Minitest`](minitest) runs
minitest-implicit-subject
Implicit declaration of the test subject.
minitest-instrument
Instrument ActiveSupport::Notifications when test method is executed.
minitest-instrument-db
Store information about speed of test execution provided by minitest-instrument in database.
minitest-junit
JUnit-style XML reporter for minitest.
minitest-keyword
Use [`Minitest`](minitest) assertions with keyword arguments.
minitest-libnotify
[`Test`](minitest/test) notifier for minitest via libnotify.
minitest-line
Run test at line number.
minitest-logger
Define assert\_log and enable minitest to test log messages. Supports Logger and Log4r::Logger.
minitest-macruby
Provides extensions to minitest for macruby UI testing.
minitest-matchers
Adds support for RSpec-style matchers to minitest.
minitest-matchers\_vaccine
Adds assertions that adhere to the matcher spec, but without any expectation infections.
minitest-metadata
Annotate tests with metadata (key-value).
minitest-mock\_expectations
Provides method call assertions for minitest.
minitest-mongoid
Mongoid assertion matchers for [`Minitest`](minitest).
minitest-must\_not
Provides must\_not as an alias for wont in [`Minitest`](minitest).
minitest-optional\_retry
Automatically retry failed test to help with flakiness.
minitest-osx
Reporter for the Mac OS X notification center.
minitest-parallel\_fork
Fork-based parallelization
minitest-parallel-db
Run tests in parallel with a single database.
minitest-power\_assert
PowerAssert for [`Minitest`](minitest).
minitest-predicates
Adds support for .predicate? methods.
minitest-profile
List the 10 slowest tests in your suite.
minitest-rails
[`Minitest`](minitest) integration for Rails 3.x.
minitest-rails-capybara
Capybara integration for Minitest::Rails.
minitest-reporters
Create customizable [`Minitest`](minitest) output formats.
minitest-rg
Colored red/green output for [`Minitest`](minitest).
minitest-rspec\_mocks
Use RSpec Mocks with [`Minitest`](minitest).
minitest-server
minitest-server provides a client/server setup with your minitest process, allowing your test run to send its results directly to a handler.
minitest-sequel
[`Minitest`](minitest) assertions to speed-up development and testing of Ruby Sequel database setups.
minitest-shared\_description
Support for shared specs and shared spec subclasses
minitest-should\_syntax
RSpec-style `x.should == y` assertions for [`Minitest`](minitest).
minitest-shouldify
Adding all manner of shoulds to [`Minitest`](minitest) (bad idea)
minitest-snail
Print a list of tests that take too long
minitest-spec-context
Provides rspec-ish context method to [`Minitest::Spec`](minitest/spec).
minitest-spec-expect
Expect syntax for [`Minitest::Spec`](minitest/spec) (e.g. expect(sequences).to\_include :celery\_man).
minitest-spec-magic
[`Minitest::Spec`](minitest/spec) extensions for Rails and beyond.
minitest-spec-rails
Drop in [`Minitest::Spec`](minitest/spec) superclass for ActiveSupport::TestCase.
minitest-sprint
Runs (Get it? It’s fast!) your tests and makes it easier to rerun individual failures.
minitest-stately
Find leaking state between tests
minitest-stub\_any\_instance
Stub any instance of a method on the given class for the duration of a block.
minitest-stub-const
Stub constants for the duration of a block.
minitest-tags
Add tags for minitest.
minitest-unordered
Adds a new assertion to minitest for checking the contents of a collection, ignoring element order.
minitest-vcr
Automatic cassette management with [`Minitest::Spec`](minitest/spec) and VCR.
minitest\_log
Adds structured logging, data explication, and verdicts.
minitest\_owrapper
Get tests results as a TestResult object.
minitest\_should
Shoulda style syntax for minitest test::unit.
minitest\_tu\_shim
Bridges between test/unit and minitest.
mongoid-minitest
[`Minitest`](minitest) matchers for Mongoid.
mutant-minitest
[`Minitest`](minitest) integration for mutant.
pry-rescue
A pry plugin w/ minitest support. See pry-rescue/minitest.rb.
rematch
Declutter your test files from large hardcoded data and update them automatically when your code changes.
rspec2minitest
Easily translate any RSpec matchers to [`Minitest`](minitest) assertions and expectations.
stubberry
Multiple stubbing ‘berries’, sweet and useful stub helpers and assertions. ( stub\_must, assert\_method\_called, stubbing ORM objects by id )
Unknown Extensions:
-------------------
Authors… Please send me a pull request with a description of your minitest extension.
* assay-minitest
* detroit-minitest
* em-minitest-spec
* flexmock-minitest
* guard-minitest
* guard-minitest-decisiv
* minitest-activemodel
* minitest-ar-assertions
* minitest-capybara-unit
* minitest-colorer
* minitest-deluxe
* minitest-extra-assertions
* minitest-rails-shoulda
* minitest-spec
* minitest-spec-should
* minitest-sugar
* spork-minitest
[`Minitest`](minitest) related goods
-------------------------------------
* minitest/pride fabric: [www.spoonflower.com/fabric/3928730-again-by-katie\_allen](https://www.spoonflower.com/fabric/3928730-again-by-katie_allen)
REQUIREMENTS:
-------------
* Ruby 2.3+. No magic is involved. I hope.
INSTALL:
--------
```
sudo gem install minitest
```
On 1.9, you already have it. To get newer candy you can still install the gem, and then requiring “minitest/autorun” should automatically pull it in. If not, you’ll need to do it yourself:
```
gem "minitest" # ensures you"re using the gem, and not the built-in MT
require "minitest/autorun"
# ... usual testing stuffs ...
```
DO NOTE: There is a serious problem with the way that ruby 1.9/2.0 packages their own gems. They install a gem specification file, but don’t install the gem contents in the gem path. This messes up Gem.find\_files and many other things (gem which, gem contents, etc).
Just install minitest as a gem for real and you’ll be happier.
LICENSE:
--------
(The MIT License)
Copyright © Ryan Davis, seattle.rb
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\_\_run(reporter, options) Show source
```
# File lib/minitest.rb, line 173
def self.__run reporter, options
suites = Runnable.runnables.shuffle
parallel, serial = suites.partition { |s| s.test_order == :parallel }
# If we run the parallel tests before the serial tests, the parallel tests
# could run in parallel with the serial tests. This would be bad because
# the serial tests won't lock around Reporter#record. Run the serial tests
# first, so that after they complete, the parallel tests will lock when
# recording results.
serial.map { |suite| suite.run reporter, options } +
parallel.map { |suite| suite.run reporter, options }
end
```
Internal run method. Responsible for telling all Runnable sub-classes to run.
after\_run(&block) Show source
```
# File lib/minitest.rb, line 94
def self.after_run &block
@@after_run << block
end
```
A simple hook allowing you to run a block of code after everything is done running. Eg:
```
Minitest.after_run { p $debugging_info }
```
autorun() Show source
```
# File lib/minitest.rb, line 66
def self.autorun
if Object.const_defined?(:Warning) && Warning.respond_to?(:[]=)
Warning[:deprecated] = true
end
at_exit {
next if $! and not ($!.kind_of? SystemExit and $!.success?)
exit_code = nil
pid = Process.pid
at_exit {
next if Process.pid != pid
@@after_run.reverse_each(&:call)
exit exit_code || false
}
exit_code = Minitest.run ARGV
} unless @@installed_at_exit
@@installed_at_exit = true
end
```
Registers [`Minitest`](minitest) to run at process exit
run(args = []) Show source
```
# File lib/minitest.rb, line 140
def self.run args = []
self.load_plugins unless args.delete("--no-plugins") || ENV["MT_NO_PLUGINS"]
options = process_args args
Minitest.seed = options[:seed]
srand Minitest.seed
reporter = CompositeReporter.new
reporter << SummaryReporter.new(options[:io], options)
reporter << ProgressReporter.new(options[:io], options)
self.reporter = reporter # this makes it available to plugins
self.init_plugins options
self.reporter = nil # runnables shouldn't depend on the reporter, ever
self.parallel_executor.start if parallel_executor.respond_to?(:start)
reporter.start
begin
__run reporter, options
rescue Interrupt
warn "Interrupted. Exiting..."
end
self.parallel_executor.shutdown
reporter.report
reporter.passed?
end
```
This is the top-level run method. Everything starts from here. It tells each Runnable sub-class to run, and each of those are responsible for doing whatever they do.
The overall structure of a run looks like this:
```
Minitest.autorun
Minitest.run(args)
Minitest.__run(reporter, options)
Runnable.runnables.each
runnable.run(reporter, options)
self.runnable_methods.each
self.run_one_method(self, runnable_method, reporter)
Minitest.run_one_method(klass, runnable_method)
klass.new(runnable_method).run
```
backtrace\_filter() Show source
```
# File lib/minitest.rb, line 43
cattr_accessor :backtrace_filter
```
Filter object for backtraces.
extensions() Show source
```
# File lib/minitest.rb, line 55
cattr_accessor :extensions
```
Names of known extension plugins.
info\_signal() Show source
```
# File lib/minitest.rb, line 60
cattr_accessor :info_signal
```
The signal to use for dumping information to STDERR. Defaults to “INFO”.
parallel\_executor() Show source
```
# File lib/minitest.rb, line 33
cattr_accessor :parallel_executor
```
[`Parallel`](minitest/parallel) test executor
reporter() Show source
```
# File lib/minitest.rb, line 50
cattr_accessor :reporter
```
Reporter object to be used for all runs.
NOTE: This accessor is only available during setup, not during runs.
seed() Show source
```
# File lib/minitest.rb, line 28
cattr_accessor :seed
```
The random seed used for this run. This is used to srand at the start of the run and between each `Runnable.run`.
Set via [`Minitest.run`](minitest#method-c-run) after processing args.
| programming_docs |
minitest module Minitest::Assertions module Minitest::Assertions
============================
[`Minitest`](../minitest) [`Assertions`](assertions). All assertion methods accept a `msg` which is printed if the assertion fails.
Protocol: Nearly everything here boils up to `assert`, which expects to be able to increment an instance accessor named `assertions`. This is not provided by [`Assertions`](assertions) and must be provided by the thing including [`Assertions`](assertions). See Minitest::Runnable for an example.
diff() Show source
```
# File lib/minitest/assertions.rb, line 29
def self.diff
return @diff if defined? @diff
@diff = if (RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ &&
system("diff.exe", __FILE__, __FILE__)) then
"diff.exe -u"
elsif system("gdiff", __FILE__, __FILE__)
"gdiff -u" # solaris and kin suck
elsif system("diff", __FILE__, __FILE__)
"diff -u"
else
nil
end
end
```
Returns the diff command to use in [`diff`](assertions#method-i-diff). Tries to intelligently figure out what diff to use.
diff=(o) Show source
```
# File lib/minitest/assertions.rb, line 47
def self.diff= o
@diff = o
end
```
Set the diff command to use in [`diff`](assertions#method-i-diff).
assert(test, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 178
def assert test, msg = nil
self.assertions += 1
unless test then
msg ||= "Expected #{mu_pp test} to be truthy."
msg = msg.call if Proc === msg
raise Minitest::Assertion, msg
end
true
end
```
Fails unless `test` is truthy.
assert\_empty(obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 195
def assert_empty obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to be empty" }
assert_respond_to obj, :empty?
assert obj.empty?, msg
end
```
Fails unless `obj` is empty.
assert\_equal(exp, act, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 216
def assert_equal exp, act, msg = nil
msg = message(msg, E) { diff exp, act }
result = assert exp == act, msg
if nil == exp then
if Minitest::VERSION =~ /^6/ then
refute_nil exp, "Use assert_nil if expecting nil."
else
where = Minitest.filter_backtrace(caller).first
where = where.split(/:in /, 2).first # clean up noise
warn "DEPRECATED: Use assert_nil if expecting nil from #{where}. This will fail in Minitest 6."
end
end
result
end
```
Fails unless `exp == act` printing the difference between the two, if possible.
If there is no visible difference but the assertion fails, you should suspect that your == is buggy, or your inspect output is missing crucial details. For nicer structural diffing, set [`Minitest::Test.make_my_diffs_pretty!`](test#method-c-make_my_diffs_pretty-21)
For floats use assert\_in\_delta.
See also: [`Minitest::Assertions.diff`](assertions#method-c-diff)
assert\_in\_delta(exp, act, delta = 0.001, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 240
def assert_in_delta exp, act, delta = 0.001, msg = nil
n = (exp - act).abs
msg = message(msg) {
"Expected |#{exp} - #{act}| (#{n}) to be <= #{delta}"
}
assert delta >= n, msg
end
```
For comparing Floats. Fails unless `exp` and `act` are within `delta` of each other.
```
assert_in_delta Math::PI, (22.0 / 7.0), 0.01
```
assert\_in\_epsilon(exp, act, epsilon = 0.001, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 252
def assert_in_epsilon exp, act, epsilon = 0.001, msg = nil
assert_in_delta exp, act, [exp.abs, act.abs].min * epsilon, msg
end
```
For comparing Floats. Fails unless `exp` and `act` have a relative error less than `epsilon`.
assert\_includes(collection, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 259
def assert_includes collection, obj, msg = nil
msg = message(msg) {
"Expected #{mu_pp(collection)} to include #{mu_pp(obj)}"
}
assert_respond_to collection, :include?
assert collection.include?(obj), msg
end
```
Fails unless `collection` includes `obj`.
assert\_instance\_of(cls, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 270
def assert_instance_of cls, obj, msg = nil
msg = message(msg) {
"Expected #{mu_pp(obj)} to be an instance of #{cls}, not #{obj.class}"
}
assert obj.instance_of?(cls), msg
end
```
Fails unless `obj` is an instance of `cls`.
assert\_kind\_of(cls, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 281
def assert_kind_of cls, obj, msg = nil
msg = message(msg) {
"Expected #{mu_pp(obj)} to be a kind of #{cls}, not #{obj.class}" }
assert obj.kind_of?(cls), msg
end
```
Fails unless `obj` is a kind of `cls`.
assert\_match(matcher, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 291
def assert_match matcher, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp matcher} to match #{mu_pp obj}" }
assert_respond_to matcher, :"=~"
matcher = Regexp.new Regexp.escape matcher if String === matcher
assert matcher =~ obj, msg
Regexp.last_match
end
```
Fails unless `matcher` `=~` `obj`.
assert\_mock(mock) Show source
```
# File lib/minitest/mock.rb, line 248
def assert_mock mock
assert mock.verify
end
```
Assert that the mock verifies correctly.
assert\_nil(obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 303
def assert_nil obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to be nil" }
assert obj.nil?, msg
end
```
Fails unless `obj` is nil
assert\_operator(o1, op, o2 = UNDEFINED, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 313
def assert_operator o1, op, o2 = UNDEFINED, msg = nil
return assert_predicate o1, op, msg if UNDEFINED == o2
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" }
assert o1.__send__(op, o2), msg
end
```
For testing with binary operators. Eg:
```
assert_operator 5, :<=, 4
```
assert\_output(stdout = nil, stderr = nil) { || ... } Show source
```
# File lib/minitest/assertions.rb, line 331
def assert_output stdout = nil, stderr = nil
flunk "assert_output requires a block to capture output." unless
block_given?
out, err = capture_io do
yield
end
err_msg = Regexp === stderr ? :assert_match : :assert_equal if stderr
out_msg = Regexp === stdout ? :assert_match : :assert_equal if stdout
y = send err_msg, stderr, err, "In stderr" if err_msg
x = send out_msg, stdout, out, "In stdout" if out_msg
(!stdout || x) && (!stderr || y)
rescue Assertion
raise
rescue => e
raise UnexpectedError, e
end
```
Fails if stdout or stderr do not output the expected results. Pass in nil if you don’t care about that streams output. Pass in “” if you require it to be silent. Pass in a regexp if you want to pattern match.
```
assert_output(/hey/) { method_with_output }
```
NOTE: this uses [`capture_io`](assertions#method-i-capture_io), not [`capture_subprocess_io`](assertions#method-i-capture_subprocess_io).
See also: [`assert_silent`](assertions#method-i-assert_silent)
assert\_path\_exists(path, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 355
def assert_path_exists path, msg = nil
msg = message(msg) { "Expected path '#{path}' to exist" }
assert File.exist?(path), msg
end
```
Fails unless `path` exists.
assert\_predicate(o1, op, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 369
def assert_predicate o1, op, msg = nil
msg = message(msg) { "Expected #{mu_pp(o1)} to be #{op}" }
assert o1.__send__(op), msg
end
```
For testing with predicates. Eg:
```
assert_predicate str, :empty?
```
This is really meant for specs and is front-ended by [`assert_operator`](assertions#method-i-assert_operator):
```
str.must_be :empty?
```
assert\_raises(\*exp) { || ... } Show source
```
# File lib/minitest/assertions.rb, line 396
def assert_raises *exp
flunk "assert_raises requires a block to capture errors." unless
block_given?
msg = "#{exp.pop}.\n" if String === exp.last
exp << StandardError if exp.empty?
begin
yield
rescue *exp => e
pass # count assertion
return e
rescue Minitest::Assertion # incl Skip & UnexpectedError
# don't count assertion
raise
rescue SignalException, SystemExit
raise
rescue Exception => e
flunk proc {
exception_details(e, "#{msg}#{mu_pp(exp)} exception expected, not")
}
end
exp = exp.first if exp.size == 1
flunk "#{msg}#{mu_pp(exp)} expected but nothing was raised."
end
```
Fails unless the block raises one of `exp`. Returns the exception matched so you can check the message, attributes, etc.
`exp` takes an optional message on the end to help explain failures and defaults to StandardError if no exception class is passed. Eg:
```
assert_raises(CustomError) { method_with_custom_error }
```
With custom error message:
```
assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error }
```
Using the returned object:
```
error = assert_raises(CustomError) do
raise CustomError, 'This is really bad'
end
assert_equal 'This is really bad', error.message
```
assert\_respond\_to(obj, meth, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 427
def assert_respond_to obj, meth, msg = nil
msg = message(msg) {
"Expected #{mu_pp(obj)} (#{obj.class}) to respond to ##{meth}"
}
assert obj.respond_to?(meth), msg
end
```
Fails unless `obj` responds to `meth`.
assert\_same(exp, act, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 437
def assert_same exp, act, msg = nil
msg = message(msg) {
data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]
"Expected %s (oid=%d) to be the same as %s (oid=%d)" % data
}
assert exp.equal?(act), msg
end
```
Fails unless `exp` and `act` are equal?
assert\_send(send\_ary, m = nil) Show source
```
# File lib/minitest/assertions.rb, line 450
def assert_send send_ary, m = nil
where = Minitest.filter_backtrace(caller).first
where = where.split(/:in /, 2).first # clean up noise
warn "DEPRECATED: assert_send. From #{where}"
recv, msg, *args = send_ary
m = message(m) {
"Expected #{mu_pp(recv)}.#{msg}(*#{mu_pp(args)}) to return true" }
assert recv.__send__(msg, *args), m
end
```
`send_ary` is a receiver, message and arguments.
Fails unless the call returns a true value
assert\_silent() { || ... } Show source
```
# File lib/minitest/assertions.rb, line 466
def assert_silent
assert_output "", "" do
yield
end
end
```
Fails if the block outputs anything to stderr or stdout.
See also: [`assert_output`](assertions#method-i-assert_output)
assert\_throws(sym, msg = nil) { || ... } Show source
```
# File lib/minitest/assertions.rb, line 475
def assert_throws sym, msg = nil
default = "Expected #{mu_pp(sym)} to have been thrown"
caught = true
value = catch(sym) do
begin
yield
rescue ThreadError => e # wtf?!? 1.8 + threads == suck
default += ", not \:#{e.message[/uncaught throw \`(\w+?)\'/, 1]}"
rescue ArgumentError => e # 1.9 exception
raise e unless e.message.include?("uncaught throw")
default += ", not #{e.message.split(/ /).last}"
rescue NameError => e # 1.8 exception
raise e unless e.name == sym
default += ", not #{e.name.inspect}"
end
caught = false
end
assert caught, message(msg) { default }
value
rescue Assertion
raise
rescue => e
raise UnexpectedError, e
end
```
Fails unless the block throws `sym`
capture\_io() { || ... } Show source
```
# File lib/minitest/assertions.rb, line 516
def capture_io
_synchronize do
begin
captured_stdout, captured_stderr = StringIO.new, StringIO.new
orig_stdout, orig_stderr = $stdout, $stderr
$stdout, $stderr = captured_stdout, captured_stderr
yield
return captured_stdout.string, captured_stderr.string
ensure
$stdout = orig_stdout
$stderr = orig_stderr
end
end
end
```
Captures $stdout and $stderr into strings:
```
out, err = capture_io do
puts "Some info"
warn "You did a bad thing"
end
assert_match %r%info%, out
assert_match %r%bad%, err
```
NOTE: For efficiency, this method uses StringIO and does not capture IO for subprocesses. Use [`capture_subprocess_io`](assertions#method-i-capture_subprocess_io) for that.
capture\_subprocess\_io() { || ... } Show source
```
# File lib/minitest/assertions.rb, line 549
def capture_subprocess_io
_synchronize do
begin
require "tempfile"
captured_stdout, captured_stderr = Tempfile.new("out"), Tempfile.new("err")
orig_stdout, orig_stderr = $stdout.dup, $stderr.dup
$stdout.reopen captured_stdout
$stderr.reopen captured_stderr
yield
$stdout.rewind
$stderr.rewind
return captured_stdout.read, captured_stderr.read
ensure
$stdout.reopen orig_stdout
$stderr.reopen orig_stderr
orig_stdout.close
orig_stderr.close
captured_stdout.close!
captured_stderr.close!
end
end
end
```
Captures $stdout and $stderr into strings, using Tempfile to ensure that subprocess IO is captured as well.
```
out, err = capture_subprocess_io do
system "echo Some info"
system "echo You did a bad thing 1>&2"
end
assert_match %r%info%, out
assert_match %r%bad%, err
```
NOTE: This method is approximately 10x slower than [`capture_io`](assertions#method-i-capture_io) so only use it when you need to test the output of a subprocess.
diff(exp, act) Show source
```
# File lib/minitest/assertions.rb, line 59
def diff exp, act
result = nil
expect, butwas = things_to_diff(exp, act)
return "Expected: #{mu_pp exp}\n Actual: #{mu_pp act}" unless
expect
Tempfile.open("expect") do |a|
a.puts expect
a.flush
Tempfile.open("butwas") do |b|
b.puts butwas
b.flush
result = `#{Minitest::Assertions.diff} #{a.path} #{b.path}`
result.sub!(/^\-\-\- .+/, "--- expected")
result.sub!(/^\+\+\+ .+/, "+++ actual")
if result.empty? then
klass = exp.class
result = [
"No visible difference in the #{klass}#inspect output.\n",
"You should look at the implementation of #== on ",
"#{klass} or its members.\n",
expect,
].join
end
end
end
result
end
```
Returns a diff between `exp` and `act`. If there is no known diff command or if it doesn’t make sense to diff the output (single line, short output), then it simply returns a basic comparison between the two.
See `things_to_diff` for more info.
exception\_details(e, msg) Show source
```
# File lib/minitest/assertions.rb, line 581
def exception_details e, msg
[
"#{msg}",
"Class: <#{e.class}>",
"Message: <#{e.message.inspect}>",
"---Backtrace---",
"#{Minitest.filter_backtrace(e.backtrace).join("\n")}",
"---------------",
].join "\n"
end
```
Returns details for exception `e`
fail\_after(y,m,d,msg) Show source
```
# File lib/minitest/assertions.rb, line 597
def fail_after y,m,d,msg
flunk msg if Time.now > Time.local(y, m, d)
end
```
Fails after a given date (in the local time zone). This allows you to put time-bombs in your tests if you need to keep something around until a later date lest you forget about it.
flunk(msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 604
def flunk msg = nil
msg ||= "Epic Fail!"
assert false, msg
end
```
Fails with `msg`.
message(msg = nil, ending = nil, &default) Show source
```
# File lib/minitest/assertions.rb, line 612
def message msg = nil, ending = nil, &default
proc {
msg = msg.call.chomp(".") if Proc === msg
custom_message = "#{msg}.\n" unless msg.nil? or msg.to_s.empty?
"#{custom_message}#{default.call}#{ending || "."}"
}
end
```
Returns a proc that will output `msg` along with the default message.
mu\_pp(obj) Show source
```
# File lib/minitest/assertions.rb, line 129
def mu_pp obj
s = obj.inspect
if defined? Encoding then
s = s.encode Encoding.default_external
if String === obj && (obj.encoding != Encoding.default_external ||
!obj.valid_encoding?) then
enc = "# encoding: #{obj.encoding}"
val = "# valid: #{obj.valid_encoding?}"
s = "#{enc}\n#{val}\n#{s}"
end
end
s
end
```
This returns a human-readable version of `obj`. By default inspect is called. You can override this to use pretty\_inspect if you want.
See [`Minitest::Test.make_my_diffs_pretty!`](test#method-c-make_my_diffs_pretty-21)
mu\_pp\_for\_diff(obj) Show source
```
# File lib/minitest/assertions.rb, line 152
def mu_pp_for_diff obj
str = mu_pp obj
# both '\n' & '\\n' (_after_ mu_pp (aka inspect))
single = !!str.match(/(?<!\\|^)\\n/)
double = !!str.match(/(?<=\\|^)\\n/)
process =
if single ^ double then
if single then
lambda { |s| s == "\\n" ? "\n" : s } # unescape
else
lambda { |s| s == "\\\\n" ? "\\n\n" : s } # unescape a bit, add nls
end
else
:itself # leave it alone
end
str.
gsub(/\\?\\n/, &process).
gsub(/:0x[a-fA-F0-9]{4,}/m, ":0xXXXXXX") # anonymize hex values
end
```
This returns a diff-able more human-readable version of `obj`. This differs from the regular [`mu_pp`](assertions#method-i-mu_pp) because it expands escaped newlines and makes hex-values (like object\_ids) generic. This uses [`mu_pp`](assertions#method-i-mu_pp) to do the first pass and then cleans it up.
pass(\_msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 623
def pass _msg = nil
assert true
end
```
used for counting assertions
refute(test, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 630
def refute test, msg = nil
msg ||= message { "Expected #{mu_pp(test)} to not be truthy" }
assert !test, msg
end
```
Fails if `test` is truthy.
refute\_empty(obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 638
def refute_empty obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to not be empty" }
assert_respond_to obj, :empty?
refute obj.empty?, msg
end
```
Fails if `obj` is empty.
refute\_equal(exp, act, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 649
def refute_equal exp, act, msg = nil
msg = message(msg) {
"Expected #{mu_pp(act)} to not be equal to #{mu_pp(exp)}"
}
refute exp == act, msg
end
```
Fails if `exp == act`.
For floats use refute\_in\_delta.
refute\_in\_delta(exp, act, delta = 0.001, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 661
def refute_in_delta exp, act, delta = 0.001, msg = nil
n = (exp - act).abs
msg = message(msg) {
"Expected |#{exp} - #{act}| (#{n}) to not be <= #{delta}"
}
refute delta >= n, msg
end
```
For comparing Floats. Fails if `exp` is within `delta` of `act`.
```
refute_in_delta Math::PI, (22.0 / 7.0)
```
refute\_in\_epsilon(a, b, epsilon = 0.001, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 673
def refute_in_epsilon a, b, epsilon = 0.001, msg = nil
refute_in_delta a, b, a * epsilon, msg
end
```
For comparing Floats. Fails if `exp` and `act` have a relative error less than `epsilon`.
refute\_includes(collection, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 680
def refute_includes collection, obj, msg = nil
msg = message(msg) {
"Expected #{mu_pp(collection)} to not include #{mu_pp(obj)}"
}
assert_respond_to collection, :include?
refute collection.include?(obj), msg
end
```
Fails if `collection` includes `obj`.
refute\_instance\_of(cls, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 691
def refute_instance_of cls, obj, msg = nil
msg = message(msg) {
"Expected #{mu_pp(obj)} to not be an instance of #{cls}"
}
refute obj.instance_of?(cls), msg
end
```
Fails if `obj` is an instance of `cls`.
refute\_kind\_of(cls, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 701
def refute_kind_of cls, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to not be a kind of #{cls}" }
refute obj.kind_of?(cls), msg
end
```
Fails if `obj` is a kind of `cls`.
refute\_match(matcher, obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 709
def refute_match matcher, obj, msg = nil
msg = message(msg) { "Expected #{mu_pp matcher} to not match #{mu_pp obj}" }
assert_respond_to matcher, :"=~"
matcher = Regexp.new Regexp.escape matcher if String === matcher
refute matcher =~ obj, msg
end
```
Fails if `matcher` `=~` `obj`.
refute\_nil(obj, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 719
def refute_nil obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to not be nil" }
refute obj.nil?, msg
end
```
Fails if `obj` is nil.
refute\_operator(o1, op, o2 = UNDEFINED, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 730
def refute_operator o1, op, o2 = UNDEFINED, msg = nil
return refute_predicate o1, op, msg if UNDEFINED == o2
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op} #{mu_pp(o2)}" }
refute o1.__send__(op, o2), msg
end
```
Fails if `o1` is not `op` `o2`. Eg:
```
refute_operator 1, :>, 2 #=> pass
refute_operator 1, :<, 2 #=> fail
```
refute\_path\_exists(path, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 739
def refute_path_exists path, msg = nil
msg = message(msg) { "Expected path '#{path}' to not exist" }
refute File.exist?(path), msg
end
```
Fails if `path` exists.
refute\_predicate(o1, op, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 753
def refute_predicate o1, op, msg = nil
msg = message(msg) { "Expected #{mu_pp(o1)} to not be #{op}" }
refute o1.__send__(op), msg
end
```
For testing with predicates.
```
refute_predicate str, :empty?
```
This is really meant for specs and is front-ended by [`refute_operator`](assertions#method-i-refute_operator):
```
str.wont_be :empty?
```
refute\_respond\_to(obj, meth, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 761
def refute_respond_to obj, meth, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to not respond to #{meth}" }
refute obj.respond_to?(meth), msg
end
```
Fails if `obj` responds to the message `meth`.
refute\_same(exp, act, msg = nil) Show source
```
# File lib/minitest/assertions.rb, line 770
def refute_same exp, act, msg = nil
msg = message(msg) {
data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]
"Expected %s (oid=%d) to not be the same as %s (oid=%d)" % data
}
refute exp.equal?(act), msg
end
```
Fails if `exp` is the same (by object identity) as `act`.
skip(msg = nil, bt = caller) Show source
```
# File lib/minitest/assertions.rb, line 783
def skip msg = nil, bt = caller
msg ||= "Skipped, no message given"
@skip = true
raise Minitest::Skip, msg, bt
end
```
Skips the current run. If run in verbose-mode, the skipped run gets listed at the end of the run but doesn’t cause a failure exit code.
skip\_until(y,m,d,msg) Show source
```
# File lib/minitest/assertions.rb, line 795
def skip_until y,m,d,msg
skip msg if Time.now < Time.local(y, m, d)
where = caller.first.rpartition(':in').reject(&:empty?).first
warn "Stale skip_until %p at %s" % [msg, where]
end
```
Skips the current run until a given date (in the local time zone). This allows you to put some fixes on hold until a later date, but still holds you accountable and prevents you from forgetting it.
skipped?() Show source
```
# File lib/minitest/assertions.rb, line 804
def skipped?
defined?(@skip) and @skip
end
```
Was this testcase skipped? Meant for teardown.
things\_to\_diff(exp, act) Show source
```
# File lib/minitest/assertions.rb, line 104
def things_to_diff exp, act
expect = mu_pp_for_diff exp
butwas = mu_pp_for_diff act
e1, e2 = expect.include?("\n"), expect.include?("\\n")
b1, b2 = butwas.include?("\n"), butwas.include?("\\n")
need_to_diff =
(e1 ^ e2 ||
b1 ^ b2 ||
expect.size > 30 ||
butwas.size > 30 ||
expect == butwas) &&
Minitest::Assertions.diff
need_to_diff && [expect, butwas]
end
```
Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff.
Criterion:
1. Strings include newlines or escaped newlines, but not both.
2. or: String lengths are > 30 characters.
3. or: Strings are equal to each other (but maybe different encodings?).
4. and: we found a diff executable.
| programming_docs |
minitest class Minitest::BacktraceFilter class Minitest::BacktraceFilter
================================
Parent:
[Object](../object)
The standard backtrace filter for minitest.
See Minitest.backtrace\_filter=.
filter(bt) Show source
```
# File lib/minitest.rb, line 1035
def filter bt
return ["No backtrace"] unless bt
return bt.dup if $DEBUG || ENV["MT_DEBUG"]
new_bt = bt.take_while { |line| line !~ MT_RE }
new_bt = bt.select { |line| line !~ MT_RE } if new_bt.empty?
new_bt = bt.dup if new_bt.empty?
new_bt
end
```
Filter `bt` to something useful. Returns the whole thing if $DEBUG (ruby) or $MT\_DEBUG (env).
minitest module Minitest::Reportable module Minitest::Reportable
============================
Shared code for anything that can get passed to a Reporter. See [`Minitest::Test`](test) & [`Minitest::Result`](result).
error?() Show source
```
# File lib/minitest.rb, line 516
def error?
self.failures.any? { |f| UnexpectedError === f }
end
```
Did this run error?
location() Show source
```
# File lib/minitest.rb, line 490
def location
loc = " [#{self.failure.location}]" unless passed? or error?
"#{self.class_name}##{self.name}#{loc}"
end
```
The location identifier of this test. Depends on a method existing called class\_name.
passed?() Show source
```
# File lib/minitest.rb, line 482
def passed?
not self.failure
end
```
Did this run pass?
Note: skipped runs are not considered passing, but they don’t cause the process to exit non-zero.
result\_code() Show source
```
# File lib/minitest.rb, line 502
def result_code
self.failure and self.failure.result_code or "."
end
```
Returns “.”, “F”, or “E” based on the result of the run.
skipped?() Show source
```
# File lib/minitest.rb, line 509
def skipped?
self.failure and Skip === self.failure
end
```
Was this run skipped?
minitest class Minitest::PrideIO class Minitest::PrideIO
========================
Parent:
[Object](../object)
Show your testing pride!
ESC
Start an escape sequence
NND
End the escape sequence
io[R] The IO we’re going to pipe through.
pride!() Show source
```
# File lib/minitest/pride_plugin.rb, line 28
def self.pride!
@pride = true
end
```
Activate the pride plugin. Called from both -p option and minitest/pride
pride?() Show source
```
# File lib/minitest/pride_plugin.rb, line 35
def self.pride?
@pride ||= false
end
```
Are we showing our testing pride?
pride(string) Show source
```
# File lib/minitest/pride_plugin.rb, line 89
def pride string
string = "*" if string == "."
c = @colors[@index % @size]
@index += 1
"#{ESC}#{c}m#{string}#{NND}"
end
```
Color a string.
print(o) Show source
```
# File lib/minitest/pride_plugin.rb, line 60
def print o
case o
when "." then
io.print pride o
when "E", "F" then
io.print "#{ESC}41m#{ESC}37m#{o}#{NND}"
when "S" then
io.print pride o
else
io.print o
end
end
```
Wrap print to colorize the output.
minitest class Minitest::SummaryReporter class Minitest::SummaryReporter
================================
Parent:
[Minitest::StatisticsReporter](statisticsreporter)
A reporter that prints the header, summary, and failure details at the end of the run.
This is added to the top-level [`CompositeReporter`](compositereporter) at the start of the run. If you want to change the output of minitest via a plugin, pull this out of the composite and replace it with your own.
minitest class Minitest::TestTask class Minitest::TestTask
=========================
Parent:
Rake::TaskLib
[`Minitest::TestTask`](testtask) is a rake helper that generates several rake tasks under the main test task’s name-space.
```
task <name> :: the main test task
task <name>:cmd :: prints the command to use
task <name>:deps :: runs each test file by itself to find dependency errors
task <name>:slow :: runs the tests and reports the slowest 25 tests.
```
Examples:
```
Minitest::TestTask.create
```
The most basic and default setup.
```
Minitest::TestTask.create :my_tests
```
The most basic/default setup, but with a custom name
```
Minitest::TestTask.create :unit do |t|
t.test_globs = ["test/unit/**/*_test.rb"]
t.warning = false
end
```
Customize the name and only run unit tests.
extra\_args[RW] Extra arguments to pass to the tests. Defaults empty but gets populated by a number of enviroment variables:
N (-n flag)
a string or regexp of tests to run.
X (-e flag)
a string or regexp of tests to exclude.
A (arg)
quick way to inject an arbitrary argument (eg A=–help).
See [`process_env`](testtask#method-i-process_env)
framework[RW] The code to load the framework. Defaults to requiring minitest/autorun…
Why do I have this as an option?
libs[RW] Extra library directories to include. Defaults to %w[lib test .]. Also uses $MT\_LIB\_EXTRAS allowing you to dynamically override/inject directories for custom runs.
name[RW] The name of the task and base name for the other tasks generated.
test\_globs[RW] File globs to find test files. Defaults to something sensible to find test files under the test directory.
test\_prelude[RW] Optional: Additional ruby to run before the test framework is loaded.
verbose[RW] Print out commands as they run. Defaults to Rake’s `trace` (-t flag) option.
warning[RW] Turn on ruby warnings (-w flag). Defaults to true.
create(name = :test, &block) Show source
```
# File lib/minitest/test_task.rb, line 40
def self.create name = :test, &block
task = new name
task.instance_eval(&block) if block
task.process_env
task.define
task
end
```
Create several test-oriented tasks under `name`. Takes an optional block to customize variables.
make\_test\_cmd(globs = test\_globs) Show source
```
# File lib/minitest/test_task.rb, line 256
def make_test_cmd globs = test_globs
tests = []
tests.concat Dir[*globs].sort.shuffle # TODO: SEED -> srand first?
tests.map! { |f| %(require "#{f}") }
runner = []
runner << test_prelude if test_prelude
runner << framework
runner.concat tests
runner = runner.join "; "
args = []
args << "-I#{libs.join(File::PATH_SEPARATOR)}" unless libs.empty?
args << "-w" if warning
args << '-e'
args << "'#{runner}'"
args << '--'
args << extra_args.map(&:shellescape)
args.join " "
end
```
Generate the test command-line.
process\_env() Show source
```
# File lib/minitest/test_task.rb, line 134
def process_env
warn "TESTOPTS is deprecated in Minitest::TestTask. Use A instead" if
ENV["TESTOPTS"]
warn "FILTER is deprecated in Minitest::TestTask. Use A instead" if
ENV["FILTER"]
warn "N is deprecated in Minitest::TestTask. Use MT_CPU instead" if
ENV["N"] && ENV["N"].to_i > 0
lib_extras = (ENV["MT_LIB_EXTRAS"] || "").split File::PATH_SEPARATOR
self.libs[0,0] = lib_extras
extra_args << "-n" << ENV["N"] if ENV["N"]
extra_args << "-e" << ENV["X"] if ENV["X"]
extra_args.concat Shellwords.split(ENV["TESTOPTS"]) if ENV["TESTOPTS"]
extra_args.concat Shellwords.split(ENV["FILTER"]) if ENV["FILTER"]
extra_args.concat Shellwords.split(ENV["A"]) if ENV["A"]
ENV.delete "N" if ENV["N"]
# TODO? RUBY_DEBUG = ENV["RUBY_DEBUG"]
# TODO? ENV["RUBY_FLAGS"]
extra_args.compact!
end
```
Extract variables from the environment and convert them to command line arguments. See [`extra_args`](testtask#attribute-i-extra_args).
Environment Variables:
MT\_LIB\_EXTRAS
Extra libs to dynamically override/inject for custom runs.
N
Tests to run (string or /regexp/).
X
Tests to exclude (string or /regexp/).
A
Any extra arguments. Honors shell quoting.
Deprecated:
TESTOPTS
For argument passing, use `A`.
N
For parallel testing, use `MT_CPU`.
FILTER
Same as `TESTOPTS`.
minitest class Minitest::BenchSpec class Minitest::BenchSpec
==========================
Parent:
[Minitest::Benchmark](benchmark)
The spec version of [`Minitest::Benchmark`](benchmark).
bench(name, &block) Show source
```
# File lib/minitest/benchmark.rb, line 357
def self.bench name, &block
define_method "bench_#{name.gsub(/\W+/, "_")}", &block
end
```
This is used to define a new benchmark method. You usually don’t use this directly and is intended for those needing to write new performance curve fits (eg: you need a specific polynomial fit).
See [`::bench_performance_linear`](benchspec#method-c-bench_performance_linear) for an example of how to use this.
bench\_performance\_constant(name, threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 401
def self.bench_performance_constant name, threshold = 0.99, &work
bench name do
assert_performance_constant threshold, &work
end
end
```
Create a benchmark that verifies that the performance is constant.
```
describe "my class Bench" do
bench_performance_constant "zoom_algorithm!" do |n|
@obj.zoom_algorithm!(n)
end
end
```
bench\_performance\_exponential(name, threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 416
def self.bench_performance_exponential name, threshold = 0.99, &work
bench name do
assert_performance_exponential threshold, &work
end
end
```
Create a benchmark that verifies that the performance is exponential.
```
describe "my class Bench" do
bench_performance_exponential "algorithm" do |n|
@obj.algorithm(n)
end
end
```
bench\_performance\_linear(name, threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 386
def self.bench_performance_linear name, threshold = 0.99, &work
bench name do
assert_performance_linear threshold, &work
end
end
```
Create a benchmark that verifies that the performance is linear.
```
describe "my class Bench" do
bench_performance_linear "fast_algorithm", 0.9999 do |n|
@obj.fast_algorithm(n)
end
end
```
bench\_performance\_logarithmic(name, threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 432
def self.bench_performance_logarithmic name, threshold = 0.99, &work
bench name do
assert_performance_logarithmic threshold, &work
end
end
```
Create a benchmark that verifies that the performance is logarithmic.
```
describe "my class Bench" do
bench_performance_logarithmic "algorithm" do |n|
@obj.algorithm(n)
end
end
```
bench\_performance\_power(name, threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 447
def self.bench_performance_power name, threshold = 0.99, &work
bench name do
assert_performance_power threshold, &work
end
end
```
Create a benchmark that verifies that the performance is power.
```
describe "my class Bench" do
bench_performance_power "algorithm" do |n|
@obj.algorithm(n)
end
end
```
bench\_range(&block) Show source
```
# File lib/minitest/benchmark.rb, line 370
def self.bench_range &block
return super unless block
meta = (class << self; self; end)
meta.send :define_method, "bench_range", &block
end
```
Specifies the ranges used for benchmarking for that class.
```
bench_range do
bench_exp(2, 16, 2)
end
```
See Minitest::Benchmark#bench\_range for more details.
Calls superclass method [`Minitest::Benchmark::bench_range`](benchmark#method-c-bench_range)
minitest class Minitest::Assertion class Minitest::Assertion
==========================
Parent:
Exception
Represents run failures.
location() Show source
```
# File lib/minitest.rb, line 903
def location
last_before_assertion = ""
self.backtrace.reverse_each do |s|
break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/
last_before_assertion = s
end
last_before_assertion.sub(/:in .*$/, "")
end
```
Where was this run before an assertion was raised?
minitest class Minitest::ProgressReporter class Minitest::ProgressReporter
=================================
Parent:
Minitest::Reporter
A very simple reporter that prints the “dots” during the run.
This is added to the top-level [`CompositeReporter`](compositereporter) at the start of the run. If you want to change the output of minitest via a plugin, pull this out of the composite and replace it with your own.
minitest class Minitest::PrideLOL class Minitest::PrideLOL
=========================
Parent:
[Minitest::PrideIO](prideio)
If you thought the [`PrideIO`](prideio) was colorful…
(Inspired by lolcat, but with clean math)
pride(string) Show source
```
# File lib/minitest/pride_plugin.rb, line 136
def pride string
c = @colors[@index % @size]
@index += 1
"#{ESC}38;5;#{c}m#{string}#{NND}"
end
```
Make the string even more colorful. Damnit.
minitest class Minitest::CompositeReporter class Minitest::CompositeReporter
==================================
Parent:
[Minitest::AbstractReporter](abstractreporter)
Dispatch to multiple reporters as one.
reporters[RW] The list of reporters to dispatch to.
<<(reporter) Show source
```
# File lib/minitest.rb, line 862
def << reporter
self.reporters << reporter
end
```
Add another reporter to the mix.
minitest class Minitest::Test class Minitest::Test
=====================
Parent:
[Minitest::Runnable](runnable)
Included modules:
[Minitest::Assertions](assertions), [Minitest::Reportable](reportable), [Minitest::Test::LifecycleHooks](test/lifecyclehooks), [Minitest::Guard](guard)
Subclass [`Test`](test) to create your own tests. Typically you’ll want a [`Test`](test) subclass per implementation class.
See [`Minitest::Assertions`](assertions)
i\_suck\_and\_my\_tests\_are\_order\_dependent!() Show source
```
# File lib/minitest/test.rb, line 35
def self.i_suck_and_my_tests_are_order_dependent!
class << self
undef_method :test_order if method_defined? :test_order
define_method :test_order do :alpha end
end
end
```
Call this at the top of your tests when you absolutely positively need to have ordered tests. In doing so, you’re admitting that you suck and your tests are weak.
make\_my\_diffs\_pretty!() Show source
```
# File lib/minitest/test.rb, line 48
def self.make_my_diffs_pretty!
require "pp"
define_method :mu_pp, &:pretty_inspect
end
```
Make diffs for this [`Test`](test) use pretty\_inspect so that diff in assert\_equal can have more details. NOTE: this is much slower than the regular inspect but much more usable for complex objects.
parallelize\_me!() Show source
```
# File lib/minitest/test.rb, line 59
def self.parallelize_me!
include Minitest::Parallel::Test
extend Minitest::Parallel::Test::ClassMethods
end
```
Call this at the top of your tests when you want to run your tests in parallel. In doing so, you’re admitting that you rule and your tests are awesome.
runnable\_methods() Show source
```
# File lib/minitest/test.rb, line 69
def self.runnable_methods
methods = methods_matching(/^test_/)
case self.test_order
when :random, :parallel then
srand Minitest.seed
methods.sort.shuffle
when :alpha, :sorted then
methods.sort
else
raise "Unknown test_order: #{self.test_order.inspect}"
end
end
```
Returns all instance methods starting with “test\_”. Based on test\_order, the methods are either sorted, randomized (default), or run in parallel.
test\_order() Show source
```
# File lib/minitest/test.rb, line 87
def self.test_order
:random
end
```
Defines the order to run tests (:random by default). Override this or use a convenience method to change it for your tests.
run() Show source
```
# File lib/minitest/test.rb, line 94
def run
with_info_handler do
time_it do
capture_exceptions do
SETUP_METHODS.each do |hook|
self.send hook
end
self.send self.name
end
TEARDOWN_METHODS.each do |hook|
capture_exceptions do
self.send hook
end
end
end
end
Result.from self # per contract
end
```
Runs a single test with setup/teardown hooks.
minitest class Minitest::Benchmark class Minitest::Benchmark
==========================
Parent:
Test
Subclass [`Benchmark`](benchmark) to create your own benchmark runs. Methods starting with “bench\_” get executed on a per-class.
See [`Minitest::Assertions`](assertions)
bench\_exp(min, max, base = 10) Show source
```
# File lib/minitest/benchmark.rb, line 35
def self.bench_exp min, max, base = 10
min = (Math.log10(min) / Math.log10(base)).to_i
max = (Math.log10(max) / Math.log10(base)).to_i
(min..max).map { |m| base ** m }.to_a
end
```
Returns a set of ranges stepped exponentially from `min` to `max` by powers of `base`. Eg:
```
bench_exp(2, 16, 2) # => [2, 4, 8, 16]
```
bench\_linear(min, max, step = 10) Show source
```
# File lib/minitest/benchmark.rb, line 48
def self.bench_linear min, max, step = 10
(min..max).step(step).to_a
rescue LocalJumpError # 1.8.6
r = []; (min..max).step(step) { |n| r << n }; r
end
```
Returns a set of ranges stepped linearly from `min` to `max` by `step`. Eg:
```
bench_linear(20, 40, 10) # => [20, 30, 40]
```
bench\_range() Show source
```
# File lib/minitest/benchmark.rb, line 61
def self.bench_range
bench_exp 1, 10_000
end
```
Specifies the ranges used for benchmarking for that class. Defaults to exponential growth from 1 to 10k by powers of 10. Override if you need different ranges for your benchmarks.
See also: [`::bench_exp`](benchmark#method-c-bench_exp) and [`::bench_linear`](benchmark#method-c-bench_linear).
assert\_performance(validation, &work) Show source
```
# File lib/minitest/benchmark.rb, line 83
def assert_performance validation, &work
range = self.class.bench_range
io.print "#{self.name}"
times = []
range.each do |x|
GC.start
t0 = Minitest.clock_time
instance_exec(x, &work)
t = Minitest.clock_time - t0
io.print "\t%9.6f" % t
times << t
end
io.puts
validation[range, times]
end
```
Runs the given `work`, gathering the times of each run. Range and times are then passed to a given `validation` proc. Outputs the benchmark name and times in tab-separated format, making it easy to paste into a spreadsheet for graphing or further analysis.
Ranges are specified by [`::bench_range`](benchmark#method-c-bench_range).
Eg:
```
def bench_algorithm
validation = proc { |x, y| ... }
assert_performance validation do |n|
@obj.algorithm(n)
end
end
```
assert\_performance\_constant(threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 127
def assert_performance_constant threshold = 0.99, &work
validation = proc do |range, times|
a, b, rr = fit_linear range, times
assert_in_delta 0, b, 1 - threshold
[a, b, rr]
end
assert_performance validation, &work
end
```
Runs the given `work` and asserts that the times gathered fit to match a constant rate (eg, linear slope == 0) within a given `threshold`. Note: because we’re testing for a slope of 0, R^2 is not a good determining factor for the fit, so the threshold is applied against the slope itself. As such, you probably want to tighten it from the default.
See [www.graphpad.com/guides/prism/8/curve-fitting/reg\_intepretingnonlinr2.htm](https://www.graphpad.com/guides/prism/8/curve-fitting/reg_intepretingnonlinr2.htm) for more details.
Fit is calculated by [`fit_linear`](benchmark#method-i-fit_linear).
Ranges are specified by [`::bench_range`](benchmark#method-c-bench_range).
Eg:
```
def bench_algorithm
assert_performance_constant 0.9999 do |n|
@obj.algorithm(n)
end
end
```
assert\_performance\_exponential(threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 153
def assert_performance_exponential threshold = 0.99, &work
assert_performance validation_for_fit(:exponential, threshold), &work
end
```
Runs the given `work` and asserts that the times gathered fit to match a exponential curve within a given error `threshold`.
Fit is calculated by [`fit_exponential`](benchmark#method-i-fit_exponential).
Ranges are specified by [`::bench_range`](benchmark#method-c-bench_range).
Eg:
```
def bench_algorithm
assert_performance_exponential 0.9999 do |n|
@obj.algorithm(n)
end
end
```
assert\_performance\_linear(threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 193
def assert_performance_linear threshold = 0.99, &work
assert_performance validation_for_fit(:linear, threshold), &work
end
```
Runs the given `work` and asserts that the times gathered fit to match a straight line within a given error `threshold`.
Fit is calculated by [`fit_linear`](benchmark#method-i-fit_linear).
Ranges are specified by [`::bench_range`](benchmark#method-c-bench_range).
Eg:
```
def bench_algorithm
assert_performance_linear 0.9999 do |n|
@obj.algorithm(n)
end
end
```
assert\_performance\_logarithmic(threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 173
def assert_performance_logarithmic threshold = 0.99, &work
assert_performance validation_for_fit(:logarithmic, threshold), &work
end
```
Runs the given `work` and asserts that the times gathered fit to match a logarithmic curve within a given error `threshold`.
Fit is calculated by [`fit_logarithmic`](benchmark#method-i-fit_logarithmic).
Ranges are specified by [`::bench_range`](benchmark#method-c-bench_range).
Eg:
```
def bench_algorithm
assert_performance_logarithmic 0.9999 do |n|
@obj.algorithm(n)
end
end
```
assert\_performance\_power(threshold = 0.99, &work) Show source
```
# File lib/minitest/benchmark.rb, line 213
def assert_performance_power threshold = 0.99, &work
assert_performance validation_for_fit(:power, threshold), &work
end
```
Runs the given `work` and asserts that the times gathered curve fit to match a power curve within a given error `threshold`.
Fit is calculated by [`fit_power`](benchmark#method-i-fit_power).
Ranges are specified by [`::bench_range`](benchmark#method-c-bench_range).
Eg:
```
def bench_algorithm
assert_performance_power 0.9999 do |x|
@obj.algorithm
end
end
```
fit\_error(xys) { |x| ... } Show source
```
# File lib/minitest/benchmark.rb, line 222
def fit_error xys
y_bar = sigma(xys) { |_, y| y } / xys.size.to_f
ss_tot = sigma(xys) { |_, y| (y - y_bar) ** 2 }
ss_err = sigma(xys) { |x, y| (yield(x) - y) ** 2 }
1 - (ss_err / ss_tot)
end
```
Takes an array of x/y pairs and calculates the general R^2 value.
See: [en.wikipedia.org/wiki/Coefficient\_of\_determination](https://en.wikipedia.org/wiki/Coefficient_of_determination)
fit\_exponential(xs, ys) Show source
```
# File lib/minitest/benchmark.rb, line 237
def fit_exponential xs, ys
n = xs.size
xys = xs.zip(ys)
sxlny = sigma(xys) { |x, y| x * Math.log(y) }
slny = sigma(xys) { |_, y| Math.log(y) }
sx2 = sigma(xys) { |x, _| x * x }
sx = sigma xs
c = n * sx2 - sx ** 2
a = (slny * sx2 - sx * sxlny) / c
b = ( n * sxlny - sx * slny ) / c
return Math.exp(a), b, fit_error(xys) { |x| Math.exp(a + b * x) }
end
```
To fit a functional form: y = ae^(bx).
Takes x and y values and returns [a, b, r^2].
See: [mathworld.wolfram.com/LeastSquaresFittingExponential.html](https://mathworld.wolfram.com/LeastSquaresFittingExponential.html)
fit\_linear(xs, ys) Show source
```
# File lib/minitest/benchmark.rb, line 281
def fit_linear xs, ys
n = xs.size
xys = xs.zip(ys)
sx = sigma xs
sy = sigma ys
sx2 = sigma(xs) { |x| x ** 2 }
sxy = sigma(xys) { |x, y| x * y }
c = n * sx2 - sx**2
a = (sy * sx2 - sx * sxy) / c
b = ( n * sxy - sx * sy ) / c
return a, b, fit_error(xys) { |x| a + b * x }
end
```
Fits the functional form: a + bx.
Takes x and y values and returns [a, b, r^2].
See: [mathworld.wolfram.com/LeastSquaresFitting.html](https://mathworld.wolfram.com/LeastSquaresFitting.html)
fit\_logarithmic(xs, ys) Show source
```
# File lib/minitest/benchmark.rb, line 259
def fit_logarithmic xs, ys
n = xs.size
xys = xs.zip(ys)
slnx2 = sigma(xys) { |x, _| Math.log(x) ** 2 }
slnx = sigma(xys) { |x, _| Math.log(x) }
sylnx = sigma(xys) { |x, y| y * Math.log(x) }
sy = sigma(xys) { |_, y| y }
c = n * slnx2 - slnx ** 2
b = ( n * sylnx - sy * slnx ) / c
a = (sy - b * slnx) / n
return a, b, fit_error(xys) { |x| a + b * Math.log(x) }
end
```
To fit a functional form: y = a + b\*ln(x).
Takes x and y values and returns [a, b, r^2].
See: [mathworld.wolfram.com/LeastSquaresFittingLogarithmic.html](https://mathworld.wolfram.com/LeastSquaresFittingLogarithmic.html)
fit\_power(xs, ys) Show source
```
# File lib/minitest/benchmark.rb, line 303
def fit_power xs, ys
n = xs.size
xys = xs.zip(ys)
slnxlny = sigma(xys) { |x, y| Math.log(x) * Math.log(y) }
slnx = sigma(xs) { |x | Math.log(x) }
slny = sigma(ys) { | y| Math.log(y) }
slnx2 = sigma(xs) { |x | Math.log(x) ** 2 }
b = (n * slnxlny - slnx * slny) / (n * slnx2 - slnx ** 2)
a = (slny - b * slnx) / n
return Math.exp(a), b, fit_error(xys) { |x| (Math.exp(a) * (x ** b)) }
end
```
To fit a functional form: y = ax^b.
Takes x and y values and returns [a, b, r^2].
See: [mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html](https://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html)
sigma(enum, &block) Show source
```
# File lib/minitest/benchmark.rb, line 324
def sigma enum, &block
enum = enum.map(&block) if block
enum.inject { |sum, n| sum + n }
end
```
Enumerates over `enum` mapping `block` if given, returning the sum of the result. Eg:
```
sigma([1, 2, 3]) # => 1 + 2 + 3 => 6
sigma([1, 2, 3]) { |n| n ** 2 } # => 1 + 4 + 9 => 14
```
validation\_for\_fit(msg, threshold) Show source
```
# File lib/minitest/benchmark.rb, line 333
def validation_for_fit msg, threshold
proc do |range, times|
a, b, rr = send "fit_#{msg}", range, times
assert_operator rr, :>=, threshold
[a, b, rr]
end
end
```
Returns a proc that calls the specified fit method and asserts that the error is within a tolerable threshold.
| programming_docs |
minitest class Minitest::Runnable class Minitest::Runnable
=========================
Parent:
[Object](../object)
Represents anything “runnable”, like [`Test`](test), [`Spec`](spec), [`Benchmark`](benchmark), or whatever you can dream up.
Subclasses of this are automatically registered and available in [`Runnable.runnables`](runnable#method-c-runnables).
assertions[RW] Number of assertions executed in this run.
failures[RW] An assertion raised during the run, if any.
time[RW] The time it took to run.
methods\_matching(re) Show source
```
# File lib/minitest.rb, line 318
def self.methods_matching re
public_instance_methods(true).grep(re).map(&:to_s)
end
```
Returns all instance methods matching the pattern `re`.
run(reporter, options = {}) Show source
```
# File lib/minitest.rb, line 333
def self.run reporter, options = {}
filter = options[:filter] || "/./"
filter = Regexp.new $1 if filter.is_a?(String) && filter =~ %r%/(.*)/%
filtered_methods = self.runnable_methods.find_all { |m|
filter === m || filter === "#{self}##{m}"
}
exclude = options[:exclude]
exclude = Regexp.new $1 if exclude =~ %r%/(.*)/%
filtered_methods.delete_if { |m|
exclude === m || exclude === "#{self}##{m}"
}
return if filtered_methods.empty?
with_info_handler reporter do
filtered_methods.each do |method_name|
run_one_method self, method_name, reporter
end
end
end
```
Responsible for running all runnable methods in a given class, each in its own instance. Each instance is passed to the reporter to record.
run\_one\_method(klass, method\_name, reporter) Show source
```
# File lib/minitest.rb, line 363
def self.run_one_method klass, method_name, reporter
reporter.prerecord klass, method_name
reporter.record Minitest.run_one_method(klass, method_name)
end
```
Runs a single method and has the reporter record the result. This was considered internal API but is factored out of run so that subclasses can specialize the running of an individual test. See Minitest::ParallelTest::ClassMethods for an example.
runnable\_methods() Show source
```
# File lib/minitest.rb, line 400
def self.runnable_methods
raise NotImplementedError, "subclass responsibility"
end
```
Each subclass of Runnable is responsible for overriding this method to return all runnable methods. See methods\_matching.
runnables() Show source
```
# File lib/minitest.rb, line 407
def self.runnables
@@runnables
end
```
Returns all subclasses of Runnable.
name() Show source
```
# File lib/minitest.rb, line 304
def name
@NAME
end
```
Name of the run.
name=(o) Show source
```
# File lib/minitest.rb, line 311
def name= o
@NAME = o
end
```
Set the name of the run.
passed?() Show source
```
# File lib/minitest.rb, line 450
def passed?
raise NotImplementedError, "subclass responsibility"
end
```
Did this run pass?
Note: skipped runs are not considered passing, but they don’t cause the process to exit non-zero.
result\_code() Show source
```
# File lib/minitest.rb, line 459
def result_code
raise NotImplementedError, "subclass responsibility"
end
```
Returns a single character string to print based on the result of the run. One of `"."`, `"F"`, `"E"` or `"S"`.
run() Show source
```
# File lib/minitest.rb, line 440
def run
raise NotImplementedError, "subclass responsibility"
end
```
Runs a single method. Needs to return self.
skipped?() Show source
```
# File lib/minitest.rb, line 466
def skipped?
raise NotImplementedError, "subclass responsibility"
end
```
Was this run skipped? See [`passed?`](runnable#method-i-passed-3F) for more information.
minitest class Minitest::UnexpectedError class Minitest::UnexpectedError
================================
Parent:
[Minitest::Assertion](assertion)
[`Assertion`](assertion) wrapping an unexpected error that was raised during a run.
minitest class Minitest::StatisticsReporter class Minitest::StatisticsReporter
===================================
Parent:
Minitest::Reporter
A reporter that gathers statistics about a test run. Does not do any IO because meant to be used as a parent class for a reporter that does.
If you want to create an entirely different type of output (eg, CI, HTML, etc), this is the place to start.
Example:
```
class JenkinsCIReporter < StatisticsReporter
def report
super # Needed to calculate some statistics
print "<testsuite "
print "tests='#{count}' "
print "failures='#{failures}' "
# Remaining XML...
end
end
```
assertions[RW] Total number of assertions.
count[RW] Total number of test cases.
errors[RW] Total number of tests that erred.
failures[RW] Total number of tests that failed.
results[RW] An `Array` of test cases that failed or were skipped.
skips[RW] Total number of tests that where skipped.
start\_time[RW] Time the test run started. If available, the monotonic clock is used and this is a `Float`, otherwise it’s an instance of `Time`.
total\_time[RW] [`Test`](test) run time. If available, the monotonic clock is used and this is a `Float`, otherwise it’s an instance of `Time`.
report() Show source
```
# File lib/minitest.rb, line 754
def report
aggregate = results.group_by { |r| r.failure.class }
aggregate.default = [] # dumb. group_by should provide this
self.total_time = Minitest.clock_time - start_time
self.failures = aggregate[Assertion].size
self.errors = aggregate[UnexpectedError].size
self.skips = aggregate[Skip].size
end
```
Report on the tracked statistics.
minitest class Minitest::Result class Minitest::Result
=======================
Parent:
[Minitest::Runnable](runnable)
Included modules:
[Minitest::Reportable](reportable)
This represents a test result in a clean way that can be marshalled over a wire. Tests can do anything they want to the test instance and can create conditions that cause Marshal.dump to blow up. By using [`Result.from(a_test)`](result#method-c-from) you can be reasonably sure that the test result can be marshalled.
klass[RW] The class name of the test result.
source\_location[RW] The location of the test method.
from(runnable) Show source
```
# File lib/minitest.rb, line 547
def self.from runnable
o = runnable
r = self.new o.name
r.klass = o.class.name
r.assertions = o.assertions
r.failures = o.failures.dup
r.time = o.time
r.source_location = o.method(o.name).source_location rescue ["unknown", -1]
r
end
```
Create a new test result from a Runnable instance.
minitest module Minitest::Guard module Minitest::Guard
=======================
Provides a simple set of guards that you can use in your tests to skip execution if it is not applicable. These methods are mixed into [`Test`](test) as both instance and class methods so you can use them inside or outside of the test methods.
```
def test_something_for_mri
skip "bug 1234" if jruby?
# ...
end
if windows? then
# ... lots of test methods ...
end
```
jruby?(platform = RUBY\_PLATFORM) Show source
```
# File lib/minitest.rb, line 976
def jruby? platform = RUBY_PLATFORM
"java" == platform
end
```
Is this running on jruby?
maglev?(platform = defined?(RUBY\_ENGINE) && RUBY\_ENGINE) Show source
```
# File lib/minitest.rb, line 983
def maglev? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
where = Minitest.filter_backtrace(caller).first
where = where.split(/:in /, 2).first # clean up noise
warn "DEPRECATED: `maglev?` called from #{where}. This will fail in Minitest 6."
"maglev" == platform
end
```
Is this running on maglev?
mri?(platform = RUBY\_DESCRIPTION) Show source
```
# File lib/minitest.rb, line 993
def mri? platform = RUBY_DESCRIPTION
/^ruby/ =~ platform
end
```
Is this running on mri?
osx?(platform = RUBY\_PLATFORM) Show source
```
# File lib/minitest.rb, line 1000
def osx? platform = RUBY_PLATFORM
/darwin/ =~ platform
end
```
Is this running on macOS?
rubinius?(platform = defined?(RUBY\_ENGINE) && RUBY\_ENGINE) Show source
```
# File lib/minitest.rb, line 1007
def rubinius? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
where = Minitest.filter_backtrace(caller).first
where = where.split(/:in /, 2).first # clean up noise
warn "DEPRECATED: `rubinius?` called from #{where}. This will fail in Minitest 6."
"rbx" == platform
end
```
Is this running on rubinius?
windows?(platform = RUBY\_PLATFORM) Show source
```
# File lib/minitest.rb, line 1017
def windows? platform = RUBY_PLATFORM
/mswin|mingw/ =~ platform
end
```
Is this running on windows?
minitest class Minitest::Mock class Minitest::Mock
=====================
Parent:
[Object](../object)
A simple and clean mock object framework.
All mock objects are an instance of [`Mock`](mock)
expect(name, retval, args = [], \*\*kwargs, &blk) Show source
```
# File lib/minitest/mock.rb, line 91
def expect name, retval, args = [], **kwargs, &blk
name = name.to_sym
if block_given?
raise ArgumentError, "args ignored when block given" unless args.empty?
raise ArgumentError, "kwargs ignored when block given" unless kwargs.empty?
@expected_calls[name] << { :retval => retval, :block => blk }
else
raise ArgumentError, "args must be an array" unless Array === args
if ENV["MT_KWARGS_HAC\K"] && (Hash === args.last ||
Hash == args.last) then
if kwargs.empty? then
kwargs = args.pop
else
unless @@KW_WARNED then
from = caller.first
warn "Using MT_KWARGS_HAC\K yet passing kwargs. From #{from}"
@@KW_WARNED = true
end
end
end
@expected_calls[name] <<
{ :retval => retval, :args => args, :kwargs => kwargs }
end
self
end
```
Expect that method `name` is called, optionally with `args` (and `kwargs` or a `blk`, and returns `retval`.
```
@mock.expect(:meaning_of_life, 42)
@mock.meaning_of_life # => 42
@mock.expect(:do_something_with, true, [some_obj, true])
@mock.do_something_with(some_obj, true) # => true
@mock.expect(:do_something_else, true) do |a1, a2|
a1 == "buggs" && a2 == :bunny
end
```
`args` is compared to the expected args using case equality (ie, the ‘===’ operator), allowing for less specific expectations.
```
@mock.expect(:uses_any_string, true, [String])
@mock.uses_any_string("foo") # => true
@mock.verify # => true
@mock.expect(:uses_one_string, true, ["foo"])
@mock.uses_one_string("bar") # => raises MockExpectationError
```
If a method will be called multiple times, specify a new expect for each one. They will be used in the order you define them.
```
@mock.expect(:ordinal_increment, 'first')
@mock.expect(:ordinal_increment, 'second')
@mock.ordinal_increment # => 'first'
@mock.ordinal_increment # => 'second'
@mock.ordinal_increment # => raises MockExpectationError "No more expects available for :ordinal_increment"
```
verify() Show source
```
# File lib/minitest/mock.rb, line 140
def verify
@expected_calls.each do |name, expected|
actual = @actual_calls.fetch(name, nil)
raise MockExpectationError, "expected #{__call name, expected[0]}" unless actual
raise MockExpectationError, "expected #{__call name, expected[actual.size]}, got [#{__call name, actual}]" if
actual.size < expected.size
end
true
end
```
Verify that all methods were called as expected. Raises `MockExpectationError` if the mock object was not called as expected.
minitest class Minitest::AbstractReporter class Minitest::AbstractReporter
=================================
Parent:
[Object](../object)
Included modules:
Defines the API for Reporters. Subclass this and override whatever you want. Go nuts.
passed?() Show source
```
# File lib/minitest.rb, line 612
def passed?
true
end
```
Did this run pass?
prerecord(klass, name) Show source
```
# File lib/minitest.rb, line 591
def prerecord klass, name
end
```
About to start running a test. This allows a reporter to show that it is starting or that we are in the middle of a test run.
record(result) Show source
```
# File lib/minitest.rb, line 600
def record result
end
```
Output and record the result of the test. Call [result#result\_code](runnable#method-i-result_code) to get the result character string. Stores the result of the run if the run did not pass.
report() Show source
```
# File lib/minitest.rb, line 606
def report
end
```
Outputs the summary of the run.
start() Show source
```
# File lib/minitest.rb, line 584
def start
end
```
Starts reporting on the run.
minitest class Minitest::Spec class Minitest::Spec
=====================
Parent:
[Minitest::Test](test)
[`Minitest::Spec`](spec) – The faster, better, less-magical spec framework!
For a list of expectations, see [`Minitest::Expectations`](expectations).
minitest class Minitest::Skip class Minitest::Skip
=====================
Parent:
[Minitest::Assertion](assertion)
[`Assertion`](assertion) raised when skipping a run.
minitest module Minitest::Expectations module Minitest::Expectations
==============================
It’s where you hide your “assertions”.
Please note, because of the way that expectations are implemented, all expectations (eg [`must_equal`](expectations#method-i-must_equal)) are dependent upon a thread local variable `:current_spec`. If your specs rely on mixing threads into the specs themselves, you’re better off using assertions or the new \_(value) wrapper. For example:
```
it "should still work in threads" do
my_threaded_thingy do
(1+1).must_equal 2 # bad
assert_equal 2, 1+1 # good
_(1 + 1).must_equal 2 # good
value(1 + 1).must_equal 2 # good, also #expect
_ { 1 + "1" }.must_raise TypeError # good
end
end
```
must\_be() Show source
```
# File lib/minitest/expectations.rb, line 116
infect_an_assertion :assert_operator, :must_be, :reverse
```
See [`Minitest::Assertions#assert_operator`](assertions#method-i-assert_operator)
```
_(n).must_be :<=, 42
```
This can also do predicates:
```
_(str).must_be :empty?
```
must\_be\_close\_to() Show source
```
# File lib/minitest/expectations.rb, line 47
infect_an_assertion :assert_in_delta, :must_be_close_to
```
See [`Minitest::Assertions#assert_in_delta`](assertions#method-i-assert_in_delta)
```
_(n).must_be_close_to m [, delta]
```
must\_be\_empty() Show source
```
# File lib/minitest/expectations.rb, line 29
infect_an_assertion :assert_empty, :must_be_empty, :unary
```
See [`Minitest::Assertions#assert_empty`](assertions#method-i-assert_empty).
```
_(collection).must_be_empty
```
must\_be\_instance\_of() Show source
```
# File lib/minitest/expectations.rb, line 76
infect_an_assertion :assert_instance_of, :must_be_instance_of
```
See [`Minitest::Assertions#assert_instance_of`](assertions#method-i-assert_instance_of)
```
_(obj).must_be_instance_of klass
```
must\_be\_kind\_of() Show source
```
# File lib/minitest/expectations.rb, line 85
infect_an_assertion :assert_kind_of, :must_be_kind_of
```
See [`Minitest::Assertions#assert_kind_of`](assertions#method-i-assert_kind_of)
```
_(obj).must_be_kind_of mod
```
must\_be\_nil() Show source
```
# File lib/minitest/expectations.rb, line 103
infect_an_assertion :assert_nil, :must_be_nil, :unary
```
See [`Minitest::Assertions#assert_nil`](assertions#method-i-assert_nil)
```
_(obj).must_be_nil
```
must\_be\_same\_as() Show source
```
# File lib/minitest/expectations.rb, line 152
infect_an_assertion :assert_same, :must_be_same_as
```
See [`Minitest::Assertions#assert_same`](assertions#method-i-assert_same)
```
_(a).must_be_same_as b
```
must\_be\_silent() Show source
```
# File lib/minitest/expectations.rb, line 161
infect_an_assertion :assert_silent, :must_be_silent, :block
```
See [`Minitest::Assertions#assert_silent`](assertions#method-i-assert_silent)
```
_ { ... }.must_be_silent
```
must\_be\_within\_epsilon() Show source
```
# File lib/minitest/expectations.rb, line 58
infect_an_assertion :assert_in_epsilon, :must_be_within_epsilon
```
See [`Minitest::Assertions#assert_in_epsilon`](assertions#method-i-assert_in_epsilon)
```
_(n).must_be_within_epsilon m [, epsilon]
```
must\_equal() Show source
```
# File lib/minitest/expectations.rb, line 38
infect_an_assertion :assert_equal, :must_equal
```
See [`Minitest::Assertions#assert_equal`](assertions#method-i-assert_equal)
```
_(a).must_equal b
```
must\_include() Show source
```
# File lib/minitest/expectations.rb, line 67
infect_an_assertion :assert_includes, :must_include, :reverse
```
See [`Minitest::Assertions#assert_includes`](assertions#method-i-assert_includes)
```
_(collection).must_include obj
```
must\_match() Show source
```
# File lib/minitest/expectations.rb, line 94
infect_an_assertion :assert_match, :must_match
```
See [`Minitest::Assertions#assert_match`](assertions#method-i-assert_match)
```
_(a).must_match b
```
must\_output() Show source
```
# File lib/minitest/expectations.rb, line 125
infect_an_assertion :assert_output, :must_output, :block
```
See [`Minitest::Assertions#assert_output`](assertions#method-i-assert_output)
```
_ { ... }.must_output out_or_nil [, err]
```
must\_raise() Show source
```
# File lib/minitest/expectations.rb, line 134
infect_an_assertion :assert_raises, :must_raise, :block
```
See [`Minitest::Assertions#assert_raises`](assertions#method-i-assert_raises)
```
_ { ... }.must_raise exception
```
must\_respond\_to() Show source
```
# File lib/minitest/expectations.rb, line 143
infect_an_assertion :assert_respond_to, :must_respond_to, :reverse
```
See [`Minitest::Assertions#assert_respond_to`](assertions#method-i-assert_respond_to)
```
_(obj).must_respond_to msg
```
must\_throw() Show source
```
# File lib/minitest/expectations.rb, line 170
infect_an_assertion :assert_throws, :must_throw, :block
```
See [`Minitest::Assertions#assert_throws`](assertions#method-i-assert_throws)
```
_ { ... }.must_throw sym
```
path\_must\_exist() Show source
```
# File lib/minitest/expectations.rb, line 179
infect_an_assertion :assert_path_exists, :path_must_exist, :unary
```
See [`Minitest::Assertions#assert_path_exists`](assertions#method-i-assert_path_exists)
```
_(some_path).path_must_exist
```
path\_wont\_exist() Show source
```
# File lib/minitest/expectations.rb, line 188
infect_an_assertion :refute_path_exists, :path_wont_exist, :unary
```
See [`Minitest::Assertions#refute_path_exists`](assertions#method-i-refute_path_exists)
```
_(some_path).path_wont_exist
```
wont\_be() Show source
```
# File lib/minitest/expectations.rb, line 284
infect_an_assertion :refute_operator, :wont_be, :reverse
```
See [`Minitest::Assertions#refute_operator`](assertions#method-i-refute_operator)
```
_(n).wont_be :<=, 42
```
This can also do predicates:
```
str.wont_be :empty?
```
wont\_be\_close\_to() Show source
```
# File lib/minitest/expectations.rb, line 215
infect_an_assertion :refute_in_delta, :wont_be_close_to
```
See [`Minitest::Assertions#refute_in_delta`](assertions#method-i-refute_in_delta)
```
_(n).wont_be_close_to m [, delta]
```
wont\_be\_empty() Show source
```
# File lib/minitest/expectations.rb, line 197
infect_an_assertion :refute_empty, :wont_be_empty, :unary
```
See [`Minitest::Assertions#refute_empty`](assertions#method-i-refute_empty)
```
_(collection).wont_be_empty
```
wont\_be\_instance\_of() Show source
```
# File lib/minitest/expectations.rb, line 244
infect_an_assertion :refute_instance_of, :wont_be_instance_of
```
See [`Minitest::Assertions#refute_instance_of`](assertions#method-i-refute_instance_of)
```
_(obj).wont_be_instance_of klass
```
wont\_be\_kind\_of() Show source
```
# File lib/minitest/expectations.rb, line 253
infect_an_assertion :refute_kind_of, :wont_be_kind_of
```
See [`Minitest::Assertions#refute_kind_of`](assertions#method-i-refute_kind_of)
```
_(obj).wont_be_kind_of mod
```
wont\_be\_nil() Show source
```
# File lib/minitest/expectations.rb, line 271
infect_an_assertion :refute_nil, :wont_be_nil, :unary
```
See [`Minitest::Assertions#refute_nil`](assertions#method-i-refute_nil)
```
_(obj).wont_be_nil
```
wont\_be\_same\_as() Show source
```
# File lib/minitest/expectations.rb, line 302
infect_an_assertion :refute_same, :wont_be_same_as
```
See [`Minitest::Assertions#refute_same`](assertions#method-i-refute_same)
```
_(a).wont_be_same_as b
```
wont\_be\_within\_epsilon() Show source
```
# File lib/minitest/expectations.rb, line 226
infect_an_assertion :refute_in_epsilon, :wont_be_within_epsilon
```
See [`Minitest::Assertions#refute_in_epsilon`](assertions#method-i-refute_in_epsilon)
```
_(n).wont_be_within_epsilon m [, epsilon]
```
wont\_equal() Show source
```
# File lib/minitest/expectations.rb, line 206
infect_an_assertion :refute_equal, :wont_equal
```
See [`Minitest::Assertions#refute_equal`](assertions#method-i-refute_equal)
```
_(a).wont_equal b
```
wont\_include() Show source
```
# File lib/minitest/expectations.rb, line 235
infect_an_assertion :refute_includes, :wont_include, :reverse
```
See [`Minitest::Assertions#refute_includes`](assertions#method-i-refute_includes)
```
_(collection).wont_include obj
```
wont\_match() Show source
```
# File lib/minitest/expectations.rb, line 262
infect_an_assertion :refute_match, :wont_match
```
See [`Minitest::Assertions#refute_match`](assertions#method-i-refute_match)
```
_(a).wont_match b
```
wont\_respond\_to() Show source
```
# File lib/minitest/expectations.rb, line 293
infect_an_assertion :refute_respond_to, :wont_respond_to, :reverse
```
See [`Minitest::Assertions#refute_respond_to`](assertions#method-i-refute_respond_to)
```
_(obj).wont_respond_to msg
```
| programming_docs |
minitest class Minitest::Parallel::Executor class Minitest::Parallel::Executor
===================================
Parent:
[Object](../../object)
The engine used to run multiple tests in parallel.
size[R] The size of the pool of workers.
new(size) Show source
```
# File lib/minitest/parallel.rb, line 17
def initialize size
@size = size
@queue = Queue.new
@pool = nil
end
```
Create a parallel test executor of with `size` workers.
<<(work;) Show source
```
# File lib/minitest/parallel.rb, line 43
def << work; @queue << work; end
```
Add a job to the queue
shutdown() Show source
```
# File lib/minitest/parallel.rb, line 50
def shutdown
size.times { @queue << nil }
@pool.each(&:join)
end
```
Shuts down the pool of workers by signalling them to quit and waiting for them all to finish what they’re currently working on.
start() Show source
```
# File lib/minitest/parallel.rb, line 26
def start
@pool = size.times.map {
Thread.new(@queue) do |queue|
Thread.current.abort_on_exception = true
while (job = queue.pop)
klass, method, reporter = job
reporter.synchronize { reporter.prerecord klass, method }
result = Minitest.run_one_method klass, method
reporter.synchronize { reporter.record result }
end
end
}
end
```
Start the executor
minitest module Minitest::Test::LifecycleHooks module Minitest::Test::LifecycleHooks
======================================
Provides before/after hooks for setup and teardown. These are meant for library writers, NOT for regular test authors. See [`before_setup`](lifecyclehooks#method-i-before_setup) for an example.
after\_setup() Show source
```
# File lib/minitest/test.rb, line 171
def after_setup; end
```
Runs before every test, after setup. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.
See [`before_setup`](lifecyclehooks#method-i-before_setup) for an example.
after\_teardown() Show source
```
# File lib/minitest/test.rb, line 195
def after_teardown; end
```
Runs after every test, after teardown. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.
See [`before_setup`](lifecyclehooks#method-i-before_setup) for an example.
before\_setup() Show source
```
# File lib/minitest/test.rb, line 156
def before_setup; end
```
Runs before every test, before setup. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.
As a simplistic example:
```
module MyMinitestPlugin
def before_setup
super
# ... stuff to do before setup is run
end
def after_setup
# ... stuff to do after setup is run
super
end
def before_teardown
super
# ... stuff to do before teardown is run
end
def after_teardown
# ... stuff to do after teardown is run
super
end
end
class MiniTest::Test
include MyMinitestPlugin
end
```
before\_teardown() Show source
```
# File lib/minitest/test.rb, line 180
def before_teardown; end
```
Runs after every test, before teardown. This hook is meant for libraries to extend minitest. It is not meant to be used by test developers.
See [`before_setup`](lifecyclehooks#method-i-before_setup) for an example.
setup() Show source
```
# File lib/minitest/test.rb, line 162
def setup; end
```
Runs before every test. Use this to set up before each test run.
teardown() Show source
```
# File lib/minitest/test.rb, line 186
def teardown; end
```
Runs after every test. Use this to clean up after each test run.
minitest module Minitest::Spec::DSL module Minitest::Spec::DSL
===========================
Oh look! A [`Minitest::Spec::DSL`](dsl) module! Eat your heart out DHH.
TYPES
Contains pairs of matchers and [`Spec`](../spec) classes to be used to calculate the superclass of a top-level describe. This allows for automatically customizable spec types.
See: [`register_spec_type`](dsl#method-i-register_spec_type) and [`spec_type`](dsl#method-i-spec_type)
after(\_type = nil, &block) Show source
```
# File lib/minitest/spec.rb, line 205
def after _type = nil, &block
define_method :teardown do
self.instance_eval(&block)
super()
end
end
```
Define an ‘after’ action. Inherits the way normal methods should.
NOTE: `type` is ignored and is only there to make porting easier.
Equivalent to [`Minitest::Test#teardown`](../test/lifecyclehooks#method-i-teardown).
Calls superclass method before(\_type = nil, &block) Show source
```
# File lib/minitest/spec.rb, line 191
def before _type = nil, &block
define_method :setup do
super()
self.instance_eval(&block)
end
end
```
Define a ‘before’ action. Inherits the way normal methods should.
NOTE: `type` is ignored and is only there to make porting easier.
Equivalent to [`Minitest::Test#setup`](../test/lifecyclehooks#method-i-setup).
Calls superclass method it(desc = "anonymous", &block) Show source
```
# File lib/minitest/spec.rb, line 223
def it desc = "anonymous", &block
block ||= proc { skip "(no tests defined)" }
@specs ||= 0
@specs += 1
name = "test_%04d_%s" % [ @specs, desc ]
undef_klasses = self.children.reject { |c| c.public_method_defined? name }
define_method name, &block
undef_klasses.each do |undef_klass|
undef_klass.send :undef_method, name
end
name
end
```
Define an expectation with name `desc`. Name gets morphed to a proper test method name. For some freakish reason, people who write specs don’t like class inheritance, so this goes way out of its way to make sure that expectations aren’t inherited.
This is also aliased to [`specify`](dsl#method-i-specify) and doesn’t require a `desc` arg.
Hint: If you *do* want inheritance, use minitest/test. You can mix and match between assertions and expectations as much as you want.
Also aliased as: [specify](dsl#method-i-specify) let(name, &block) Show source
```
# File lib/minitest/spec.rb, line 247
def let name, &block
name = name.to_s
pre, post = "let '#{name}' cannot ", ". Please use another name."
methods = Minitest::Spec.instance_methods.map(&:to_s) - %w[subject]
raise ArgumentError, "#{pre}begin with 'test'#{post}" if
name =~ /\Atest/
raise ArgumentError, "#{pre}override a method in Minitest::Spec#{post}" if
methods.include? name
define_method name do
@_memoized ||= {}
@_memoized.fetch(name) { |k| @_memoized[k] = instance_eval(&block) }
end
end
```
Essentially, define an accessor for `name` with `block`.
Why use let instead of def? I honestly don’t know.
register\_spec\_type(\*args, &block) Show source
```
# File lib/minitest/spec.rb, line 146
def register_spec_type *args, &block
if block then
matcher, klass = block, args.first
else
matcher, klass = *args
end
TYPES.unshift [matcher, klass]
end
```
Register a new type of spec that matches the spec’s description. This method can take either a Regexp and a spec class or a spec class and a block that takes the description and returns true if it matches.
Eg:
```
register_spec_type(/Controller$/, Minitest::Spec::Rails)
```
or:
```
register_spec_type(Minitest::Spec::RailsModel) do |desc|
desc.superclass == ActiveRecord::Base
end
```
spec\_type(desc, \*additional) Show source
```
# File lib/minitest/spec.rb, line 160
def spec_type desc, *additional
TYPES.find { |matcher, _klass|
if matcher.respond_to? :call then
matcher.call desc, *additional
else
matcher === desc.to_s
end
}.last
end
```
Figure out the spec class to use based on a spec’s description. Eg:
```
spec_type("BlahController") # => Minitest::Spec::Rails
```
specify(desc = "anonymous", &block) Alias for: [it](dsl#method-i-it) subject(&block) Show source
```
# File lib/minitest/spec.rb, line 266
def subject &block
let :subject, &block
end
```
Another lazy man’s accessor generator. Made even more lazy by setting the name for you to `subject`.
minitest module Minitest::Spec::DSL::InstanceMethods module Minitest::Spec::DSL::InstanceMethods
============================================
Rdoc… why are you so dumb?
\_(value = nil, &block) Show source
```
# File lib/minitest/spec.rb, line 322
def _ value = nil, &block
Minitest::Expectation.new block || value, self
end
```
Takes a value or a block and returns a value monad that has all of Expectations methods available to it.
```
_(1 + 1).must_equal 2
```
And for blocks:
```
_ { 1 + "1" }.must_raise TypeError
```
This method of expectation-based testing is preferable to straight-expectation methods (on [`Object`](../../../object)) because it stores its test context, bypassing our hacky use of thread-local variables.
NOTE: At some point, the methods on [`Object`](../../../object) will be deprecated and then removed.
It is also aliased to [`value`](instancemethods#method-i-value) and [`expect`](instancemethods#method-i-expect) for your aesthetic pleasure:
```
_(1 + 1).must_equal 2
value(1 + 1).must_equal 2
expect(1 + 1).must_equal 2
```
Also aliased as: [value](instancemethods#method-i-value), [expect](instancemethods#method-i-expect) expect(value = nil, &block) Alias for: [\_](instancemethods#method-i-_) value(value = nil, &block) Alias for: [\_](instancemethods#method-i-_)
bluebird Why bluebird? Why bluebird?
=============
There are many third party promise libraries available for JavaScript and even the standard library contains a promise implementation in newer versions of browsers and node/io.js. This page will explore why one might use bluebird promises over other third party or the standard library implementations. For reasons to use promises in general, see the [Why Promises?](why-promises) article.
### Bluebird design principles
Bluebird is built with the following design principles in mind:
* **Pragmatic and not theoretical.** - Bluebird will always pick the pragmatic route vs the theoretically elegant one when there is a conflict. The library's API was created based on real-life use cases and after a lot of consideration.
* **Fully featured without bloat** - Bluebird provides all the tools and utilities needed to realize a highly expressive and fluent DSL for asynchronous JavaScript without suffering from bloat by avoiding incorporating features that are solely motivated by theoretical arguments, have extremely narrow applicability, or have limited synergy and composability with existing features.
* **Easy to debug** - A major consequence of choosing pragmatism over theoretical elegance, a property that is unique to bluebird among promise libraries taken to this extent.
+ Bluebird ships with the best cross-platform long stack traces out there and a warning system. This helps you recognize common and devastating promise usage mistakes early before they lead to hard to debug code later.
+ Unhandled errors are not silently swallowed by default but reported along with helpful stack traces where applicable. All of this is of course configurable.
* **Zero overhead abstraction** - In server-side applications the performance of a promise implementation matters. Bluebird's server-side performance is measured with highly relevant and realistic end-to-end macro <benchmarks>, and consistently comes out on top. We understand that if bluebird is as close to a zero cost abstraction as possible, developers won't be tempted to short-circuit and absorb complexity themselves.
* **Runs everywhere** - Bluebird runs on pretty much every platform. This makes bluebird ideal for projects who care about providing consistent cross-platform and cross-version experience. It runs on old IE, it has even been known to run on Netscape 7.
* **Spec compatible** - Bluebird can work as a drop-in replacement for native promises for an instant performance boost. It passes the Promises/A+ test suite and is fully spec compliant.
bluebird Installation Installation
============
* [Browser installation](#browser-installation)
* [Node installation](#node-installation)
* [Supported platforms](#supported-platforms)
Browser installation
---------------------
Download [bluebird 3.7.2 (development)](https://cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.js)
Unminified source file meant to be used in development. Warnings and long stack traces are enabled which are taxing on performance.
```
<script src="//cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.js"></script>
```
Download [bluebird 3.7.2 (production)](https://cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js)
Minified source file meant to be used in production. Warnings and long straces are disabled. The gzipped size is 17.76KB.
```
<script src="//cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js"></script>
```
Unless an AMD loader is installed, the script tag installation exposes the library in the `Promise` and `P` namespaces. If you want to restore the `Promise` namespace, use `var Bluebird = Promise.noConflict()`.
### Bower
```
$ bower install --save bluebird
```
### Browserify and Webpack
```
$ npm install bluebird
```
Using webpack for development/debugging:
```
var Promise = require("bluebird");
// Configure webpack and browserify for development/debugging
Promise.config({
longStackTraces: true,
warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
})
```
Using webpack for production/performance:
```
var Promise = require("bluebird");
// Configure webpack and browserify for production/performance
Promise.config({
longStackTraces: false,
warnings: false
})
```
Node installation
------------------
```
$ npm install bluebird
```
```
var Promise = require("bluebird");
```
To enable long stack traces and warnings in node development:
```
$ NODE_ENV=development node server.js
```
To enable long stack traces and warnings in node production:
```
$ BLUEBIRD_DEBUG=1 node server.js
```
See [`Environment Variables`](api/environment-variables).
Supported platforms
--------------------
Bluebird officially supports and is tested on node.js, iojs and browsers starting from IE7. Unofficial platforms are supported with best effort only.
IE7 and IE8 do not support using keywords as property names, so if supporting these browsers is required you need to use the compatibility aliases:
* [`Promise.try()`](api/promise.try) -> `Promise.attempt()`
* [`.catch()`](api/catch) -> `.caught()`
* [`.finally()`](api/finally) -> `.lastly()`
* [`.return()`](api/return) -> `.thenReturn()`
* [`.throw()`](api/throw) -> `.thenThrow()`
Long stack traces are only supported in Chrome, recent Firefoxes and Internet Explorer 10+
bluebird API Reference API Reference
=============
* [Core](api/core)
+ [new Promise](api/new-promise)
+ [.then](api/then)
+ [.spread](api/spread)
+ [.catch](api/catch)
+ [.error](api/error)
+ [.finally](api/finally)
+ [.bind](api/bind)
+ [Promise.join](api/promise.join)
+ [Promise.try](api/promise.try)
+ [Promise.method](api/promise.method)
+ [Promise.resolve](api/promise.resolve)
+ [Promise.reject](api/promise.reject)
* [Synchronous inspection](api/synchronous-inspection)
+ [PromiseInspection](api/promiseinspection)
+ [.isFulfilled](api/isfulfilled)
+ [.isRejected](api/isrejected)
+ [.isPending](api/ispending)
+ [.isCancelled](api/iscancelled)
+ [.value](api/value)
+ [.reason](api/reason)
* [Collections](api/collections)
+ [Promise.all](api/promise.all)
+ [Promise.props](api/promise.props)
+ [Promise.any](api/promise.any)
+ [Promise.some](api/promise.some)
+ [Promise.map](api/promise.map)
+ [Promise.reduce](api/promise.reduce)
+ [Promise.filter](api/promise.filter)
+ [Promise.each](api/promise.each)
+ [Promise.mapSeries](api/promise.mapseries)
+ [Promise.race](api/promise.race)
+ [.all](api/all)
+ [.props](api/props)
+ [.any](api/any)
+ [.some](api/some)
+ [.map](api/map)
+ [.reduce](api/reduce)
+ [.filter](api/filter)
+ [.each](api/each)
+ [.mapSeries](api/mapseries)
* [Resource management](api/resource-management)
+ [Promise.using](api/promise.using)
+ [.disposer](api/disposer)
* [Promisification](api/promisification)
+ [Promise.promisify](api/promise.promisify)
+ [Promise.promisifyAll](api/promise.promisifyall)
+ [Promise.fromCallback](api/promise.fromcallback)
+ [.asCallback](api/ascallback)
* [Timers](api/timers)
+ [Promise.delay](api/promise.delay)
+ [.delay](api/delay)
+ [.timeout](api/timeout)
* [Cancellation](api/cancellation)
+ [.cancel](api/cancel)
* [Generators](api/generators)
+ [Promise.coroutine](api/promise.coroutine)
+ [Promise.coroutine.addYieldHandler](api/promise.coroutine.addyieldhandler)
* [Utility](api/utility)
+ [.tap](api/tap)
+ [.tapCatch](api/tapcatch)
+ [.call](api/call)
+ [.get](api/get)
+ [.return](api/return)
+ [.throw](api/throw)
+ [.catchReturn](api/catchreturn)
+ [.catchThrow](api/catchthrow)
+ [.reflect](api/reflect)
+ [Promise.getNewLibraryCopy](api/promise.getnewlibrarycopy)
+ [Promise.noConflict](api/promise.noconflict)
+ [Promise.setScheduler](api/promise.setscheduler)
* [Built-in error types](api/built-in-error-types)
+ [OperationalError](api/operationalerror)
+ [TimeoutError](api/timeouterror)
+ [CancellationError](api/cancellationerror)
+ [AggregateError](api/aggregateerror)
* [Configuration](api/error-management-configuration)
+ [Global rejection events](api/error-management-configuration#global-rejection-events)
+ [Local rejection events](api/promise.onpossiblyunhandledrejection)
+ [Promise.config](api/promise.config)
+ [.suppressUnhandledRejections](api/suppressunhandledrejections)
+ [.done](api/done)
* [Progression migration](api/progression-migration)
* [Deferred migration](api/deferred-migration)
* [Environment variables](api/environment-variables)
bluebird Deprecated APIs Deprecated APIs
===============
> This article is partially or completely unfinished. You are welcome to create [pull requests](https://github.com/petkaantonov/bluebird/edit/master/docs/docs/deprecated-apis.md) to help completing this article.
This file contains documentation for APIs that are no longer supported by Bluebird. These APIs still work in Bluebird but will be removed at a future version of the library.
For every use case that the methods below solve there exists a better alternative in [the API reference](index).
* [Progression](#progression)
+ [`.progressed(Function handler)`](#progressedfunction-handler---promise)
+ [`.then([Function fulfilledHandler] [, Function rejectedHandler ] [, Function progressHandler ])`](#thenfunction-fulfilledhandler--function-rejectedhandler---function-progresshandler----promise)
+ [`.done([Function fulfilledHandler] [, Function rejectedHandler ] [, Function progressHandler ])`](#donefunction-fulfilledhandler--function-rejectedhandler---function-progresshandler----promise)
* [Promise resolution](#promise-resolution)
+ [`.resolve(dynamic value)`](#resolvedynamic-value---undefined)
+ [`.reject(dynamic reason)`](#rejectdynamic-reason---undefined)
+ [`.progress(dynamic value)`](#progressdynamic-value---undefined)
+ [`.callback`](#callback---function)
+ [Old Promise Cancellation](#old-promise-cancellation)
Progression
------------
The old progression API was meant to be used for tracking the progress of promise resolution. In retrospect, it did not work or compose very well. We understand that problem better now and the use case could be better solved without it.
See [Progression Migration](api/progression-migration) for migration assistance and examples of how to convert APIs that use progression to ones that do not.
##### `.progressed(Function handler)` -> `Promise`
Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise.
##### `.then([Function fulfilledHandler] [, Function rejectedHandler ] [, Function progressHandler ])` -> `Promise`
The standard [Promises/A+ `.then()`](http://promises-aplus.github.io/promises-spec/) is still supported by Bluebird and support for it will continue indefinitely . However, the variant accepting a third `progressHandler` argument is no longer supported.
##### `.done([Function fulfilledHandler] [, Function rejectedHandler ] [, Function progressHandler ])` -> `void`
Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. Again, only the variant with the progression handler is deprecated here. `.done` is still fully supported.
Promise resolution
-------------------
A `PromiseResolver` can be used to control the fate of a promise. It is like "Deferred" in jQuery or `$q.defer` in $q. The `PromiseResolver` objects have a `.promise` property which returns a reference to the controlled promise that can be passed to clients. `.promise` of a `PromiseResolver` is not a getter function to match other implementations.
The methods of a `PromiseResolver` have no effect if the fate of the underlying promise is already decided (follow, reject, fulfill).
**The use of `Promise.defer` and deferred objects is discouraged - it is much more awkward and error-prone than using `new Promise`.**
##### `.resolve(dynamic value)` -> `undefined`
Resolve the underlying promise with `value` as the resolution value. If `value` is a thenable or a promise, the underlying promise will assume its state.
##### `.reject(dynamic reason)` -> `undefined`
Reject the underlying promise with `reason` as the rejection reason.
##### `.progress(dynamic value)` -> `undefined`
Progress the underlying promise with `value` as the progression value.
Example
```
function delay(ms) {
var resolver = Promise.defer();
var now = Date.now();
setTimeout(function(){
resolver.resolve(Date.now() - now);
}, ms);
return resolver.promise;
}
delay(500).then(function(ms){
console.log(ms + " ms passed");
});
```
Old Promise Cancellation
-------------------------
In 2.x, promise cancellation looked very differently. Promise cancellation received a major overhaul for version 3 in order to create a sound variant of cancellable promises. You can still use 2.x cancellation with bluebird 2.x (which is still supported - but not recommended). See [Cancellation](http://bluebirdjs.com/cancellation.html) for more details. The 2.x docs are [still accessible under the 2.x branch](https://github.com/petkaantonov/bluebird/blob/2.x/API.md).
| programming_docs |
bluebird Changelog Changelog
=========
3.7.2 (2019-11-28)
-------------------
Bugfixes:
* Fixes firefox settimeout not initialized error ([`#1623`](https://github.com/petkaantonov/bluebird/issues/1623))
3.7.1 (2019-10-15)
-------------------
Features:
* feature
Bugfixes:
* Fix ([`#1614`](https://github.com/petkaantonov/bluebird/issues/1614))
* Fix ([`#1613`](https://github.com/petkaantonov/bluebird/issues/1613))
* Fix ([`#1616`](https://github.com/petkaantonov/bluebird/issues/1616))
3.7.0 (2019-10-01)
-------------------
Features:
* Add [`Promise.allSettled`](api/promise.allsettled) method ([`#1606`](https://github.com/petkaantonov/bluebird/issues/1606))
3.6.0 (2019-10-01)
-------------------
Features:
* Add support for AsyncResource ([`#1403`](https://github.com/petkaantonov/bluebird/issues/1403))
Bugfixes:
* Fix [`.reduce`](api/reduce) generating unhandled rejection events ([`#1501`](https://github.com/petkaantonov/bluebird/issues/1501))
* Fix [`Promise.reduce`](api/promise.reduce) generating unhandled rejction events ([`#1502`](https://github.com/petkaantonov/bluebird/issues/1502))
* Fix [`.map`](api/map) and [`.filter`](api/filter) generating unhandled rejection events ([`#1487`](https://github.com/petkaantonov/bluebird/issues/1487))
* Fix [`Promise.map`](api/promise.map) unhandled rejection events ([`#1489`](https://github.com/petkaantonov/bluebird/issues/1489))
* Fix cancel skipping upward propagation ([`#1459`](https://github.com/petkaantonov/bluebird/issues/1459))
* Fix loadTimes deprecation ([`#1505`](https://github.com/petkaantonov/bluebird/issues/1505))
* Fix [`Promise.each`](api/promise.each) maximum stack exceeded error ([`#1326`](https://github.com/petkaantonov/bluebird/issues/1326))
* Make PromiseRejectionEvent confrom to spec ([`#1509`](https://github.com/petkaantonov/bluebird/issues/1509))
* Fix false unhandled rejection events ([`#1468`](https://github.com/petkaantonov/bluebird/issues/1468))
3.5.5 (2019-05-24)
-------------------
Features:
* Added Symbol.toStringTag support to Promise ([`#1421`](https://github.com/petkaantonov/bluebird/issues/1421))
Bugfixes:
* Fix error in IE9 ([`#1591`](https://github.com/petkaantonov/bluebird/issues/1591), [`#1592`](https://github.com/petkaantonov/bluebird/issues/1592))
* Fix error with undefined stack trace ([`#1537`](https://github.com/petkaantonov/bluebird/issues/1537))
* Fix [`.catch`](api/catch) throwing an error later rather than immediately when passed non-function handler ([`#1517`](https://github.com/petkaantonov/bluebird/issues/1517))
3.5.4 (2019-04-03)
-------------------
* Proper version check supporting VSCode([`#1576`](https://github.com/petkaantonov/bluebird/issues/1576))
3.5.3 (2018-11-06)
-------------------
Bugfixes:
* Update acorn dependency
3.5.2 (2018-09-03)
-------------------
Bugfixes:
* Fix `PromiseRejectionEvent` to contain `.reason` and `.promise` properties. ([`#1509`](https://github.com/petkaantonov/bluebird/issues/1509), [`#1464`](https://github.com/petkaantonov/bluebird/issues/1464))
* Fix promise chain retaining memory until the entire chain is resolved ([`#1544`](https://github.com/petkaantonov/bluebird/issues/1544), [`#1529`](https://github.com/petkaantonov/bluebird/issues/1529))
3.5.1 (2017-10-04)
-------------------
Bugfixes:
* Fix false positive unhandled rejection when using async await ([`#1404`](https://github.com/petkaantonov/bluebird/issues/1404))
* Fix false positive when reporting error as non-error ([`#990`](https://github.com/petkaantonov/bluebird/issues/990))
3.5.0 (2017-03-03)
-------------------
Features:
* Added new method: [`.tapCatch`](api/tapcatch) ([`#1220`](https://github.com/petkaantonov/bluebird/issues/1220))
Bugfixes:
* Fixed streamline benchmarks ([`#1233`](https://github.com/petkaantonov/bluebird/issues/1233))
* Fixed yielding a function calling the function ([`#1314`](https://github.com/petkaantonov/bluebird/issues/1314), [`#1315`](https://github.com/petkaantonov/bluebird/issues/1315))
* Fixed confusing error message when calling [`.catch`](api/catch) with non function predicate ([`#1350`](https://github.com/petkaantonov/bluebird/issues/1350))
* Fixed [`.props`](api/props) resolving to empty object when called with empty `Map` ([`#1338`](https://github.com/petkaantonov/bluebird/issues/1338))
* Fixed confusing error message when invoking `Promise` directly without `new` ([`#1320`](https://github.com/petkaantonov/bluebird/issues/1320))
* Added dedicated webpack entry point ([`#1318`](https://github.com/petkaantonov/bluebird/issues/1318))
3.4.7 (2016-12-22)
-------------------
* Promise config returns reference to Bluebird library
* Updated logo
* Benchmark fix
* Don't drop syntaxerror context from stack traces
* Fix environment variables sometimes causing long stack traces to be enabled
3.4.6 (2016-09-01)
-------------------
Bugfixes:
* Fix [`Promise.map`](api/promise.map) and [`.map`](api/map) not always calling the callback asynchronously ([`#1148`](https://github.com/petkaantonov/bluebird/issues/1148))
3.4.5 (2016-08-31)
-------------------
Bugfixes:
* Fix unhandled error regression introduced in 3.4.3 [`#1217`](https://github.com/petkaantonov/bluebird/issues/1217)
3.4.4 (2016-08-30)
-------------------
Bugfixes:
* Fix benchmark parallel in node 6 [`#1165`](https://github.com/petkaantonov/bluebird/issues/1165)
* Fix memory leak with Promise.each [`#1057`](https://github.com/petkaantonov/bluebird/issues/1057)
* Fix thenable passed to .return being evaluated too early [`#1210`](https://github.com/petkaantonov/bluebird/issues/1210)
* Fix "unhandledrejection" event not having .detail field when using DOM3 event listener api [`#1209`](https://github.com/petkaantonov/bluebird/issues/1209)
* Fix [`Promise.join`](api/promise.join) not ensuring asynchronous callback [`#1153`](https://github.com/petkaantonov/bluebird/issues/1153)
* Fix domains leaking when synchronous error is thrown while a domain is active [`#1125`](https://github.com/petkaantonov/bluebird/issues/1125)
3.4.3 (2016-08-25)
-------------------
Bugfixes:
* The "a promise was created in a handler but not returned from it" warning now highlights the file, line and column where the return statement is missing.
+ The "a promise was created in a handler but not returned from it" warning now adds the bluebird API method used to create the non-returned promise at the top of the warning stack
3.4.2 (2016-08-24)
-------------------
Bugfixes:
* Add missing link to unhandled warning docs ([`#1205`](https://github.com/petkaantonov/bluebird/issues/1205))
* Fix [`Promise.delay`](api/promise.delay) not having a long stack trace ([`#1182`](https://github.com/petkaantonov/bluebird/issues/1182))
* Fix false unhandled rejection when a rejected promise originating from one copy of bluebird is passed to another copy's [`.return`](api/return) or [`.catchReturn`](api/catchreturn) ([`#1186`](https://github.com/petkaantonov/bluebird/issues/1186))
* Fix Promise.resolve is not a function error ([`#1192`](https://github.com/petkaantonov/bluebird/issues/1192))
* Fix global events not being fired through DOM 3 API inside a worker ([`#1190`](https://github.com/petkaantonov/bluebird/issues/1190))
* Fix .cancel() not immediately marking a promise as being cancelled if it has cancellable parent ([`#1187`](https://github.com/petkaantonov/bluebird/issues/1187))
* Fix maximum callstack exceeded with [`Promise.coroutine`](api/promise.coroutine) ([`#1170`](https://github.com/petkaantonov/bluebird/issues/1170))
3.4.1 (2016-06-17)
-------------------
Features:
* Added [`Promise.getNewLibraryCopy`](api/promise.getnewlibrarycopy)
3.4.0 (2016-05-17)
-------------------
Features:
* Add `Promise.version` which tells the bluebird version as a string e.g. `"3.4.0"` ([`#1042`](https://github.com/petkaantonov/bluebird/issues/1042)).
* [`.map`](api/map), [`Promise.map`](api/promise.map), [`.filter`](api/filter) and [`Promise.filter`](api/promise.filter) now return rejected promise when inappropriate options argument is passed ([`#1097`](https://github.com/petkaantonov/bluebird/issues/1097)).
Bugfixes:
* Fix bug where callback to [`.disposer`](api/disposer) is not called if the resource is `null` ([`#1099`](https://github.com/petkaantonov/bluebird/issues/1099)).
* Fix bug where assimilating thenable throws unexpectedly when using hostile host objects as thenables ([`#1104`](https://github.com/petkaantonov/bluebird/issues/1104)).
3.3.5 (2016-04-12)
-------------------
Bugfixes:
* Fix then sometimes not being called on iOS/Firefox ([`#1022`](https://github.com/petkaantonov/bluebird/issues/1022)).
* Fix custom schedulers not being called when using promisified functions ([`#1023`](https://github.com/petkaantonov/bluebird/issues/1023)).
* Fix unexpected error being thrown when promisifed function is called with no arguments ([`#1063`](https://github.com/petkaantonov/bluebird/issues/1063)).
3.3.4 (2016-03-07)
-------------------
Features:
* Warnings about created promises that are not returned are no longer given if the handler promise has not been chained. This should reduce the amount of false positives with this warning.
3.3.3 (2016-02-25)
-------------------
Bugfixes:
* Fix stack overflow error when a promise returned by promisified function rejects early in a huge array when using [`Promise.mapSeries`](api/promise.mapseries) or [`Promise.each`](api/promise.each)
3.3.2 (2016-02-25)
-------------------
Bugfixes:
* Fix missing newline in stack trace reported by [`.done()`](api/done) ([`#1020`](https://github.com/petkaantonov/bluebird/issues/1020)).
* Detect deep circular resolutions
3.3.1 (2016-02-13)
-------------------
Bugfixes:
* Fix crash when cancelling a [`.tap()`](api/tap) handler promise ([`#1006`](https://github.com/petkaantonov/bluebird/issues/1006)).
3.3.0 (2016-02-12)
-------------------
Features:
* Cancelling Promise returned from [`Promise.delay()`](api/promise.delay) and [`.delay()`](api/delay) now calls `clearTimeout` ([`#1000`](https://github.com/petkaantonov/bluebird/issues/1000))
* Add [monitoring and lifecycle hooks](features#promise-monitoring)
* Add `'warning'` hook for warnings ([`#980`](https://github.com/petkaantonov/bluebird/issues/980))
Bugfixes:
* Fix warnings for "promise was rejected with non-error" being output when promises are rejected with errors from different realm ([`#990`](https://github.com/petkaantonov/bluebird/issues/990))
3.2.2 (2016-02-05)
-------------------
Bugfixes:
* Make build script's output work without TTY
3.2.1 (2016-02-01)
-------------------
Bugfixes:
* Revert monitoring feature due to crash in browser
3.2.0 (2016-02-01)
-------------------
* Broken build
3.1.5 (2016-01-26)
-------------------
Dummy release to trigger CDN update.
3.1.4 (2016-01-25)
-------------------
Bugfixes:
* Fix broken npm prepublish script release
3.1.3 (2016-01-25)
-------------------
Bugfixes:
* Fix generators crashing in node 0.12 ([`#978`](https://github.com/petkaantonov/bluebird/issues/978))
* Add minimal build files to build ([`#976`](https://github.com/petkaantonov/bluebird/issues/976), [`#757`](https://github.com/petkaantonov/bluebird/issues/757))
3.1.2 (2016-01-23)
-------------------
Features:
* [`.timeout()`](api/timeout) now `clearTimeout`s the timer if the resulting promise is cancelled ([`#926`](https://github.com/petkaantonov/bluebird/issues/926))
* [`Promise.coroutine`](api/promise.coroutine) now returns function with same `.length` as the original function ([`#927`](https://github.com/petkaantonov/bluebird/issues/927), [`#933`](https://github.com/petkaantonov/bluebird/issues/933))
Bugfixes:
* Fix long stack traces not working when promise is created from [`Promise.fromCallback`](api/promise.fromcallback) ([`#971`](https://github.com/petkaantonov/bluebird/issues/971))
* Fix [`.finally()`](api/finally) handlers not being called when promise is cancelled while a domain is active ([`#963`](https://github.com/petkaantonov/bluebird/issues/963))
* Fix [`.timeout()`](api/timeout) trying to cancel a promise even if cancellation is disabled ([`#970`](https://github.com/petkaantonov/bluebird/issues/970))
3.1.1 (2015-12-16)
-------------------
Bugfixes:
* Disable wForgottenWarning when all warnings are disabled
3.1.0 (2015-12-16)
-------------------
Features:
* Added ability to configure the [forgotten return statement](warning-explanations#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it) warning separately ([`#920`](https://github.com/petkaantonov/bluebird/issues/920)).
Bugfixes:
* Fixed the bug where returning a value from [`.finally`](api/finally) or [`.tap`](api/tap) handler did not make a warning about a forgotten return go away ([`#846`](https://github.com/petkaantonov/bluebird/issues/846)).
* Fixed the bug where setTimeout is used in Chrome instead of MutationObserver ([`#915`](https://github.com/petkaantonov/bluebird/issues/915))
* Fixed the bug where using [`.bind`](api/bind) suppressed unhandled rejections ([`#841`](https://github.com/petkaantonov/bluebird/issues/841))
3.0.6 (2015-12-01)
-------------------
Bugfixes:
* Fix [`.timeout()`](api/timeout) not cancelling parent ([`#891`](https://github.com/petkaantonov/bluebird/issues/891))
* Fix long stack traces when using [`Promise.resolve()`](api/promise.resolve) ([`#861`](https://github.com/petkaantonov/bluebird/issues/861))
* Fix [`Promise.config()`](api/promise.config) not disabling long stack traces when passing `longStackTraces: false` ([`#897`](https://github.com/petkaantonov/bluebird/issues/897))
3.0.5 (2015-11-01)
-------------------
Bugfixes:
* Added [forgotten return warnings](warning-explanations#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it) to [`Promise.try`](api/promise.try) and [`Promise.method`](api/promise.method)
3.0.4 (2015-11-01)
-------------------
Bugfixes:
* The stack trace for [forgotten return warnings](warning-explanations#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it) is more useful now.
3.0.3 (2015-11-01)
-------------------
Bugfixes:
* 3rd party libraries rejecting promises with non-errors no longer causes warnings
* When `NODE_ENV` environment variable is `"development"` setting `BLUEBIRD_DEBUG` environment variable to `0` can now be used to disable debug mode
3.0.2 (2015-10-29)
-------------------
Bugfixes:
* Fix crash when using node.js domains [`#829`](https://github.com/petkaantonov/bluebird/issues/829)
3.0.1 (2015-10-28)
-------------------
See [New in 3.0](new-in-bluebird-3).
3.0.0 (2015-10-27)
-------------------
See [New in 3.0](new-in-bluebird-3).
2.11.0 (2016-08-30)
--------------------
Features:
* feature
Bugfixes:
* bugfix
2.10.2 (2015-10-01)
--------------------
Features:
* [`.timeout()`](api/timeout) now takes a custom error object as second argument
2.10.1 (2015-09-21)
--------------------
* Fix error "Cannot promisify an API that has normal methods with 'Async'-suffix" when promisifying certain objects with a custom promisifier
2.10.0 (2015-09-08)
--------------------
Features:
* `Promise.using` can now take the promises-for-resources as an array ([`#733`](https://github.com/petkaantonov/bluebird/issues/733)).
* Browser builds for minimal core are now hosted on CDN ([`#724`](https://github.com/petkaantonov/bluebird/issues/724)).
Bugfixes:
* Disabling debug mode with `BLUEBIRD_DEBUG=0` environment variable now works ([`#719`](https://github.com/petkaantonov/bluebird/issues/719)).
* Fix unhandled rejection reporting when passing rejected promise to `.return()` ([`#721`](https://github.com/petkaantonov/bluebird/issues/721)).
* Fix unbound promise's then handlers being called with wrong `this` value ([`#738`](https://github.com/petkaantonov/bluebird/issues/738)).
2.9.34 (2015-07-15)
--------------------
Bugfixes:
* Correct domain for .map, .each, .filter, .reduce callbacks ([`#701`](https://github.com/petkaantonov/bluebird/issues/701)).
+ Preserve bound-with-promise promises across the entire chain ([`#702`](https://github.com/petkaantonov/bluebird/issues/702)).
2.9.33 (2015-07-09)
--------------------
Bugfixes:
* Methods on `Function.prototype` are no longer promisified ([`#680`](https://github.com/petkaantonov/bluebird/issues/680)).
2.9.32 (2015-07-03)
--------------------
Bugfixes:
* Fix `.return(primitiveValue)` returning a wrapped version of the primitive value when a Node.js domain is active ([`#689`](https://github.com/petkaantonov/bluebird/issues/689)).
2.9.31 (2015-07-03)
--------------------
Bugfixes:
* Fix Promises/A+ compliance issue regarding circular thenables: the correct behavior is to go into an infinite loop instead of warning with an error (Fixes [`#682`](https://github.com/petkaantonov/bluebird/issues/682)).
* Fix "(node) warning: possible EventEmitter memory leak detected" ([`#661`](https://github.com/petkaantonov/bluebird/issues/661)).
* Fix callbacks sometimes being called with a wrong node.js domain ([`#664`](https://github.com/petkaantonov/bluebird/issues/664)).
* Fix callbacks sometimes not being called at all in iOS 8.1 WebApp mode ([`#666`](https://github.com/petkaantonov/bluebird/issues/666), [`#687`](https://github.com/petkaantonov/bluebird/issues/687)).
2.9.30 (2015-06-14)
--------------------
Bugfixes:
* Fix regression with `promisifyAll` not promisifying certain methods
2.9.29 (2015-06-14)
--------------------
Bugfixes:
* Improve `promisifyAll` detection of functions that are class constructors. Fixes mongodb 2.x promisification.
2.9.28 (2015-06-14)
--------------------
Bugfixes:
* Fix handled rejection being reported as unhandled in certain scenarios when using [`.all`](api/all) or [`Promise.join`](api/promise.join) ([`#645`](https://github.com/petkaantonov/bluebird/issues/645))
* Fix custom scheduler not being called in Google Chrome when long stack traces are enabled ([`#650`](https://github.com/petkaantonov/bluebird/issues/650))
2.9.27 (2015-05-30)
--------------------
Bugfixes:
* Fix `sinon.useFakeTimers()` breaking scheduler ([`#631`](https://github.com/petkaantonov/bluebird/issues/631))
Misc:
* Add nw testing facilities (`node tools/test --nw`)
2.9.26 (2015-05-25)
--------------------
Bugfixes:
* Fix crash in NW [`#624`](https://github.com/petkaantonov/bluebird/issues/624)
* Fix [`.return()`](api/return) not supporting `undefined` as return value [`#627`](https://github.com/petkaantonov/bluebird/issues/627)
2.9.25 (2015-04-28)
--------------------
Bugfixes:
* Fix crash in node 0.8
2.9.24 (2015-04-02)
--------------------
Bugfixes:
* Fix not being able to load multiple bluebird copies introduced in 2.9.22 ([`#559`](https://github.com/petkaantonov/bluebird/issues/559), [`#561`](https://github.com/petkaantonov/bluebird/issues/561), [`#560`](https://github.com/petkaantonov/bluebird/issues/560)).
2.9.23 (2015-04-02)
--------------------
Bugfixes:
* Fix node.js domain propagation ([`#521`](https://github.com/petkaantonov/bluebird/issues/521)).
2.9.22 (2015-04-02)
--------------------
* Fix `.promisify` crashing in phantom JS ([`#556`](https://github.com/petkaantonov/bluebird/issues/556))
2.9.21 (2015-03-30)
--------------------
* Fix error object's `'stack'`' overwriting causing an error when its defined to be a setter that throws an error ([`#552`](https://github.com/petkaantonov/bluebird/issues/552)).
2.9.20 (2015-03-29)
--------------------
Bugfixes:
* Fix regression where there is a long delay between calling `.cancel()` and promise actually getting cancelled in Chrome when long stack traces are enabled
2.9.19 (2015-03-29)
--------------------
Bugfixes:
* Fix crashing in Chrome when long stack traces are disabled
2.9.18 (2015-03-29)
--------------------
Bugfixes:
* Fix settlePromises using trampoline
2.9.17 (2015-03-29)
--------------------
Bugfixes:
* Fix Chrome DevTools async stack traceability ([`#542`](https://github.com/petkaantonov/bluebird/issues/542)).
2.9.16 (2015-03-28)
--------------------
Features:
* Use setImmediate if available
2.9.15 (2015-03-26)
--------------------
Features:
* Added `.asCallback` alias for `.nodeify`.
Bugfixes:
* Don't always use nextTick, but try to pick up setImmediate or setTimeout in NW. Fixes [`#534`](https://github.com/petkaantonov/bluebird/issues/534), [`#525`](https://github.com/petkaantonov/bluebird/issues/525)
* Make progress a core feature. Fixes [`#535`](https://github.com/petkaantonov/bluebird/issues/535) Note that progress has been removed in 3.x - this is only a fix necessary for 2.x custom builds.
2.9.14 (2015-03-12)
--------------------
Bugfixes:
* Always use process.nextTick. Fixes [`#525`](https://github.com/petkaantonov/bluebird/issues/525)
2.9.13 (2015-02-27)
--------------------
Bugfixes:
* Fix .each, .filter, .reduce and .map callbacks being called synchornously if the input is immediate. ([`#513`](https://github.com/petkaantonov/bluebird/issues/513))
2.9.12 (2015-02-19)
--------------------
Bugfixes:
* Fix memory leak introduced in 2.9.0 ([`#502`](https://github.com/petkaantonov/bluebird/issues/502))
2.9.11 (2015-02-19)
--------------------
Bugfixes:
* Fix [`#503`](https://github.com/petkaantonov/bluebird/issues/503)
2.9.10 (2015-02-18)
--------------------
Bugfixes:
* Fix [`#501`](https://github.com/petkaantonov/bluebird/issues/501)
2.9.9 (2015-02-12)
-------------------
Bugfixes:
* Fix `TypeError: Cannot assign to read only property 'length'` when jsdom has declared a read-only length for all objects to inherit.
2.9.8 (2015-02-10)
-------------------
Bugfixes:
* Fix regression introduced in 2.9.7 where promisify didn't properly dynamically look up methods on `this`
2.9.7 (2015-02-08)
-------------------
Bugfixes:
* Fix `promisify` not retaining custom properties of the function. This enables promisifying the `"request"` module's export function and its methods at the same time.
* Fix `promisifyAll` methods being dependent on `this` when they are not originally dependent on `this`. This enables e.g. passing promisified `fs` functions directly as callbacks without having to bind them to `fs`.
* Fix `process.nextTick` being used over `setImmediate` in node.
2.9.6 (2015-02-02)
-------------------
Bugfixes:
* Node environment detection can no longer be fooled
2.9.5 (2015-02-02)
-------------------
Misc:
* Warn when [`.then()`](api/then) is passed non-functions
2.9.4 (2015-01-30)
-------------------
Bugfixes:
* Fix [`.timeout()`](api/timeout) not calling `clearTimeout` with the proper handle in node causing the process to wait for unneeded timeout. This was a regression introduced in 2.9.1.
2.9.3 (2015-01-27)
-------------------
Bugfixes:
* Fix node-webkit compatibility issue ([#467](https://github.com/petkaantonov/bluebird/pull/467))
* Fix long stack trace support in recent firefox versions
2.9.2 (2015-01-26)
-------------------
Bugfixes:
* Fix critical bug regarding to using promisifyAll in browser that was introduced in 2.9.0 ([#466](https://github.com/petkaantonov/bluebird/issues/466)).
Misc:
* Add `"browser"` entry point to package.json
2.9.1 (2015-01-24)
-------------------
Features:
* If a bound promise is returned by the callback to [`Promise.method`](api/promise.method) and [`Promise.try`](api/promise.try), the returned promise will be bound to the same value
2.9.0 (2015-01-24)
-------------------
Features:
* Add [`Promise.fromNode`](api/promise.fromnode)
* Add new paramter `value` for [`Promise.bind`](api/promise.bind)
Bugfixes:
* Fix several issues with [`cancellation`](api/cancellation) and [`.bind()`](api/bind) interoperation when `thisArg` is a promise or thenable
* Fix promises created in [`disposers`](api/disposers) not having proper long stack trace context
* Fix [`Promise.join`](api/promise.join) sometimes passing the passed in callback function as the last argument to itself.
Misc:
* Reduce minified full browser build file size by not including unused code generation functionality.
* Major internal refactoring related to testing code and source code file layout
2.8.2 (2015-01-20)
-------------------
Features:
* [Global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) are now fired both as DOM3 events and as legacy events in browsers
2.8.1 (2015-01-20)
-------------------
Bugfixes:
* Fix long stack trace stiching consistency when rejected from thenables
2.8.0 (2015-01-19)
-------------------
Features:
* Major debuggability improvements:
+ Long stack traces have been re-designed. They are now much more readable, succint, relevant and consistent across bluebird features.
+ Long stack traces are supported now in IE10+
2.7.1 (2015-01-15)
-------------------
Bugfixes:
* Fix [`#447`](https://github.com/petkaantonov/bluebird/issues/447)
2.7.0 (2015-01-15)
-------------------
Features:
* Added more context to stack traces originating from coroutines ([#421](https://github.com/petkaantonov/bluebird/issues/421))
* Implemented [global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) ([#428](https://github.com/petkaantonov/bluebird/issues/428), [#357](https://github.com/petkaantonov/bluebird/issues/357))
* [Custom promisifiers](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-promisifier) are now passed the default promisifier which can be used to add enhancements on top of normal node promisification
* [Promisification filters](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-filter) are now passed `passesDefaultFilter` boolean
Bugfixes:
* Fix `.noConflict()` call signature ([#446](changelog))
* Fix `Promise.method`ified functions being called with `undefined` when they were called with no arguments
2.6.4 (2015-01-12)
-------------------
Bugfixes:
* `OperationalErrors` thrown by promisified functions retain custom properties, such as `.code` and `.path`.
2.6.3 (2015-01-12)
-------------------
Bugfixes:
* Fix [#429](https://github.com/petkaantonov/bluebird/issues/429)
* Fix [#432](https://github.com/petkaantonov/bluebird/issues/432)
* Fix [#433](https://github.com/petkaantonov/bluebird/issues/433)
2.6.2 (2015-01-07)
-------------------
Bugfixes:
* Fix [#426](https://github.com/petkaantonov/bluebird/issues/426)
2.6.1 (2015-01-07)
-------------------
Bugfixes:
* Fixed built browser files not being included in the git tag release for bower
2.6.0 (2015-01-06)
-------------------
Features:
* Significantly improve parallel promise performance and memory usage (+50% faster, -50% less memory)
2.5.3 (2014-12-30)
-------------------
2.5.2 (2014-12-29)
-------------------
Bugfixes:
* Fix bug where already resolved promise gets attached more handlers while calling its handlers resulting in some handlers not being called
* Fix bug where then handlers are not called in the same order as they would run if Promises/A+ 2.3.2 was implemented as adoption
* Fix bug where using `Object.create(null)` as a rejection reason would crash bluebird
2.5.1 (2014-12-29)
-------------------
Bugfixes:
* Fix `.finally` throwing null error when it is derived from a promise that is resolved with a promise that is resolved with a promise
2.5.0 (2014-12-28)
-------------------
Features:
* [`.get`](api/get) now supports negative indexing.
Bugfixes:
* Fix bug with `Promise.method` wrapped function returning a promise that never resolves if the function returns a promise that is resolved with another promise
* Fix bug with `Promise.delay` never resolving if the value is a promise that is resolved with another promise
2.4.3 (2014-12-28)
-------------------
Bugfixes:
* Fix memory leak as described in [this Promises/A+ spec issue](https://github.com/promises-aplus/promises-spec/issues/179).
2.4.2 (2014-12-21)
-------------------
Bugfixes:
* Fix bug where spread rejected handler is ignored in case of rejection
* Fix synchronous scheduler passed to `setScheduler` causing infinite loop
2.4.1 (2014-12-20)
-------------------
Features:
* Error messages now have links to wiki pages for additional information
* Promises now clean up all references (to handlers, child promises etc) as soon as possible.
2.4.0 (2014-12-18)
-------------------
Features:
* Better filtering of bluebird internal calls in long stack traces, especially when using minified file in browsers
* Small performance improvements for all collection methods
* Promises now delete references to handlers attached to them as soon as possible
* Additional stack traces are now output on stderr/`console.warn` for errors that are thrown in the process/window from rejected `.done()` promises. See [#411](https://github.com/petkaantonov/bluebird/issues/411)
2.3.11 (2014-10-31)
--------------------
Bugfixes:
* Fix [#371](https://github.com/petkaantonov/bluebird/issues/371), [#373](https://github.com/petkaantonov/bluebird/issues/373)
2.3.10 (2014-10-28)
--------------------
Features:
* `Promise.method` no longer wraps primitive errors
* `Promise.try` no longer wraps primitive errors
2.3.7 (2014-10-25)
-------------------
Bugfixes:
* Fix [#359](https://github.com/petkaantonov/bluebird/issues/359), [#362](https://github.com/petkaantonov/bluebird/issues/362) and [#364](https://github.com/petkaantonov/bluebird/issues/364)
2.3.6 (2014-10-15)
-------------------
Features:
* Implement [`.reflect()`](api/reflect)
2.3.5 (2014-10-06)
-------------------
Bugfixes:
* Fix issue when promisifying methods whose names contain the string 'args'
2.3.4 (2014-09-27)
-------------------
* `P` alias was not declared inside WebWorkers
2.3.3 (2014-09-27)
-------------------
Bugfixes:
* Fix [#318](https://github.com/petkaantonov/bluebird/issues/318), [#314](https://github.com/petkaantonov/bluebird/issues/#314)
2.3.2 (2014-08-25)
-------------------
Bugfixes:
* `P` alias for `Promise` now exists in global scope when using browser builds without a module loader, fixing an issue with firefox extensions
2.3.1 (2014-08-23)
-------------------
Features:
* `.using` can now be used with disposers created from different bluebird copy
2.3.0 (2014-08-13)
-------------------
Features:
* [`.bind()`](api/bind) and [`Promise.bind()`](api/promise.bind) now await for the resolution of the `thisArg` if it's a promise or a thenable
Bugfixes:
* Fix [#276](https://github.com/petkaantonov/bluebird/issues/276)
2.2.2 (2014-07-14)
-------------------
* Fix [#259](https://github.com/petkaantonov/bluebird/issues/259)
2.2.1 (2014-07-07)
-------------------
* Fix multiline error messages only showing the first line
2.2.0 (2014-07-07)
-------------------
Bugfixes:
* `.any` and `.some` now consistently reject with RangeError when input array contains too few promises
* Fix iteration bug with `.reduce` when input array contains already fulfilled promises
2.1.3 (2014-06-18)
-------------------
Bugfixes:
* Fix [#235](https://github.com/petkaantonov/bluebird/issues/235)
2.1.2 (2014-06-15)
-------------------
Bugfixes:
* Fix [#232](https://github.com/petkaantonov/bluebird/issues/232)
2.1.1 (2014-06-11)
-------------------
2.1.0 (2014-06-11)
-------------------
Features:
* Add [`promisifier`](api/promisifier) option to `Promise.promisifyAll()`
* Improve performance of `.props()` and collection methods when used with immediate values
Bugfixes:
* Fix a bug where .reduce calls the callback for an already visited item
* Fix a bug where stack trace limit is calculated to be too small, which resulted in too short stack traces
Add undocumented experimental `yieldHandler` option to `Promise.coroutine`
2.0.7 (2014-06-08)
-------------------
2.0.6 (2014-06-07)
-------------------
2.0.5 (2014-06-05)
-------------------
2.0.4 (2014-06-05)
-------------------
2.0.3 (2014-06-05)
-------------------
2.0.2 (2014-06-04)
-------------------
2.0.1 (2014-06-04)
-------------------
2.0.0 (2014-06-04)
-------------------
What's new in 2.0
==================
* [Resource management](api-reference#resource-management) - never leak resources again
* [Promisification](api-reference#promisification) on steroids - entire modules can now be promisified with one line of code
* [`.map()`](api/map), [`.each()`](api/each), [`.filter()`](api/filter), [`.reduce()`](api/reduce) reimagined from simple sugar to powerful concurrency coordination tools
* [API Documentation](index) has been reorganized and more elaborate examples added
* Deprecated [progression](#progression-migration) and [deferreds](#deferred-migration)
* Improved performance and readability
Features:
* Added [`using()`](api/using) and [`disposer()`](api/disposer)
* [`.map()`](api/map) now calls the handler as soon as items in the input array become fulfilled
* Added a concurrency option to [`.map()`](api/map)
* [`.filter()`](api/filter) now calls the handler as soon as items in the input array become fulfilled
* Added a concurrency option to [`.filter()`](api/filter)
* [`.reduce()`](api/reduce) now calls the handler as soon as items in the input array become fulfilled, but in-order
* Added [`.each()`](api/each)
* [`Promise.resolve()`](api/promise.resolve) behaves like `Promise.cast`. `Promise.cast` deprecated.
* [Synchronous inspection](api-reference#synchronous-inspection): Removed `.inspect()`, added [`.value()`](api/value) and [`.reason()`](api/reason)
* [`Promise.join()`](api/promise.join) now takes a function as the last argument
* Added [`Promise.setScheduler()`](api/promise.setscheduler)
* [`.cancel()`](api/cancel) supports a custom cancellation reason
* [`.timeout()`](api/timeout) now cancels the promise instead of rejecting it
* [`.nodeify()`](api/nodeify) now supports passing multiple success results when mapping promises to nodebacks
* Added `suffix` and `filter` options to [`Promise.promisifyAll()`](api/promise.promisifyall)
Breaking changes:
* Sparse array holes are not skipped by collection methods but treated as existing elements with `undefined` value
* `.map()` and `.filter()` do not call the given mapper or filterer function in any specific order
* Removed the `.inspect()` method
* Yielding an array from a coroutine is not supported by default. You can use [`coroutine.addYieldHandler()`](api/coroutine.addyieldhandler) to configure the old behavior (or any behavior you want).
* [`.any()`](api/any) and [`.some()`](api/some) no longer use an array as the rejection reason. [`AggregateError`](api/aggregateerror) is used instead.
1.2.4 (2014-04-27)
-------------------
Bugfixes:
* Fix promisifyAll causing a syntax error when a method name is not a valid identifier
* Fix syntax error when es5.js is used in strict mode
1.2.3 (2014-04-17)
-------------------
Bugfixes:
* Fix [#179](https://github.com/petkaantonov/bluebird/issues/179)
1.2.2 (2014-04-09)
-------------------
Bugfixes:
* Promisified methods from promisifyAll no longer call the original method when it is overriden
* Nodeify doesn't pass second argument to the callback if the promise is fulfilled with `undefined`
1.2.1 (2014-03-31)
-------------------
Bugfixes:
* Fix [#168](https://github.com/petkaantonov/bluebird/issues/168)
1.2.0 (2014-03-29)
-------------------
Features:
* New method: [`.value()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#value---dynamic)
* New method: [`.reason()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#reason---dynamic)
* New method: [`Promise.onUnhandledRejectionHandled()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promiseonunhandledrejectionhandledfunction-handler---undefined)
* `Promise.map()`, `.map()`, `Promise.filter()` and `.filter()` start calling their callbacks as soon as possible while retaining a correct order. See [`8085922f`](https://github.com/petkaantonov/bluebird/commit/8085922fb95a9987fda0cf2337598ab4a98dc315).
Bugfixes:
* Fix [#165](https://github.com/petkaantonov/bluebird/issues/165)
* Fix [#166](https://github.com/petkaantonov/bluebird/issues/166)
1.1.1 (2014-03-18)
-------------------
Bugfixes:
* [#138](https://github.com/petkaantonov/bluebird/issues/138)
* [#144](https://github.com/petkaantonov/bluebird/issues/144)
* [#148](https://github.com/petkaantonov/bluebird/issues/148)
* [#151](https://github.com/petkaantonov/bluebird/issues/151)
1.1.0 (2014-03-08)
-------------------
Features:
* Implement [`Promise.prototype.tap()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#tapfunction-handler---promise)
* Implement [`Promise.coroutine.addYieldHandler()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisecoroutineaddyieldhandlerfunction-handler---void)
* Deprecate `Promise.prototype.spawn`
Bugfixes:
* Fix already rejected promises being reported as unhandled when handled through collection methods
* Fix browserisfy crashing from checking `process.version.indexOf`
1.0.8 (2014-03-03)
-------------------
Bugfixes:
* Fix active domain being lost across asynchronous boundaries in Node.JS 10.xx
1.0.7 (2014-02-25)
-------------------
Bugfixes:
* Fix handled errors being reported
1.0.6 (2014-02-17)
-------------------
Bugfixes:
* Fix bug with unhandled rejections not being reported when using `Promise.try` or `Promise.method` without attaching further handlers
1.0.5 (2014-02-15)
-------------------
Features:
* Node.js performance: promisified functions try to check amount of passed arguments in most optimal order
* Node.js promisified functions will have same `.length` as the original function minus one (for the callback parameter)
1.0.4 (2014-02-09)
-------------------
Features:
* Possibly unhandled rejection handler will always get a stack trace, even if the rejection or thrown error was not an error
* Unhandled rejections are tracked per promise, not per error. So if you create multiple branches from a single ancestor and that ancestor gets rejected, each branch with no error handler with the end will cause a possibly unhandled rejection handler invocation
Bugfixes:
* Fix unhandled non-writable objects or primitives not reported by possibly unhandled rejection handler
1.0.3 (2014-02-05)
-------------------
Bugfixes:
* [#93](https://github.com/petkaantonov/bluebird/issues/88)
1.0.2 (2014-02-04)
-------------------
Features:
* Significantly improve performance of foreign bluebird thenables
Bugfixes:
* [#88](https://github.com/petkaantonov/bluebird/issues/88)
1.0.1 (2014-01-28)
-------------------
Features:
* Error objects that have property `.isAsync = true` will now be caught by `.error()`
Bugfixes:
* Fix TypeError and RangeError shims not working without `new` operator
1.0.0 (2014-01-12)
-------------------
Features:
* `.filter`, `.map`, and `.reduce` no longer skip sparse array holes. This is a backwards incompatible change.
* Like `.map` and `.filter`, `.reduce` now allows returning promises and thenables from the iteration function.
Bugfixes:
* [#58](https://github.com/petkaantonov/bluebird/issues/58)
* [#61](https://github.com/petkaantonov/bluebird/issues/61)
* [#64](https://github.com/petkaantonov/bluebird/issues/64)
* [#60](https://github.com/petkaantonov/bluebird/issues/60)
0.11.6-1 (2013-12-29)
----------------------
0.11.6-0 (2013-12-29)
----------------------
Features:
* You may now return promises and thenables from the filterer function used in `Promise.filter` and `Promise.prototype.filter`.
* `.error()` now catches additional sources of rejections:
+ Rejections originating from `Promise.reject`
+ Rejections originating from thenables using the `reject` callback
+ Rejections originating from promisified callbacks which use the `errback` argument
+ Rejections originating from `new Promise` constructor where the `reject` callback is called explicitly
+ Rejections originating from `PromiseResolver` where `.reject()` method is called explicitly
Bugfixes:
* Fix `captureStackTrace` being called when it was `null`
* Fix `Promise.map` not unwrapping thenables
0.11.5-1 (2013-12-15)
----------------------
0.11.5-0 (2013-12-03)
----------------------
Features:
* Improve performance of collection methods
* Improve performance of promise chains
0.11.4-1 (2013-12-02)
----------------------
0.11.4-0 (2013-12-02)
----------------------
Bugfixes:
* Fix `Promise.some` behavior with arguments like negative integers, 0...
* Fix stack traces of synchronously throwing promisified functions'
0.11.3-0 (2013-12-02)
----------------------
Features:
* Improve performance of generators
Bugfixes:
* Fix critical bug with collection methods.
0.11.2-0 (2013-12-02)
----------------------
Features:
* Improve performance of all collection methods
0.11.1-0 (2013-12-02)
----------------------
Features:
* Improve overall performance.
* Improve performance of promisified functions.
* Improve performance of catch filters.
* Improve performance of .finally.
Bugfixes:
* Fix `.finally()` rejecting if passed non-function. It will now ignore non-functions like `.then`.
* Fix `.finally()` not converting thenables returned from the handler to promises.
* `.spread()` now rejects if the ultimate value given to it is not spreadable.
0.11.0-0 (2013-12-02)
----------------------
Features:
* Improve overall performance when not using `.bind()` or cancellation.
* Promises are now not cancellable by default. This is backwards incompatible change - see [`.cancellable()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#cancellable---promise)
* [`Promise.delay`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisedelaydynamic-value-int-ms---promise)
* [`.delay()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#delayint-ms---promise)
* [`.timeout()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#timeoutint-ms--string-message---promise)
0.10.14-0 (2013-12-01)
-----------------------
Bugfixes:
* Fix race condition when mixing 3rd party asynchrony.
0.10.13-1 (2013-11-30)
-----------------------
0.10.13-0 (2013-11-30)
-----------------------
Bugfixes:
* Fix another bug with progression.
0.10.12-0 (2013-11-30)
-----------------------
Bugfixes:
* Fix bug with progression.
0.10.11-4 (2013-11-29)
-----------------------
0.10.11-2 (2013-11-29)
-----------------------
Bugfixes:
* Fix `.race()` not propagating bound values.
0.10.11-1 (2013-11-29)
-----------------------
Features:
* Improve performance of `Promise.race`
0.10.11-0 (2013-11-29)
-----------------------
Bugfixes:
* Fixed `Promise.promisifyAll` invoking property accessors. Only data properties with function values are considered.
0.10.10-0 (2013-11-28)
-----------------------
Features:
* Disable long stack traces in browsers by default. Call `Promise.longStackTraces()` to enable them.
0.10.9-1 (2013-11-27)
----------------------
Bugfixes:
* Fail early when `new Promise` is constructed incorrectly
0.10.9-0 (2013-11-27)
----------------------
Bugfixes:
* Promise.props now takes a [thenable-for-collection](https://github.com/petkaantonov/bluebird/blob/f41edac61b7c421608ff439bb5a09b7cffeadcf9/test/mocha/props.js#L197-L217)
* All promise collection methods now reject when a promise-or-thenable-for-collection turns out not to give a collection
0.10.8-0 (2013-11-25)
----------------------
Features:
* All static collection methods take thenable-for-collection
0.10.7-0 (2013-11-25)
----------------------
Features:
* throw TypeError when thenable resolves with itself
* Make .race() and Promise.race() forever pending on empty collections
0.10.6-0 (2013-11-25)
----------------------
Bugfixes:
* Promise.resolve and PromiseResolver.resolve follow thenables too.
0.10.5-0 (2013-11-24)
----------------------
Bugfixes:
* Fix infinite loop when thenable resolves with itself
0.10.4-1 (2013-11-24)
----------------------
Bugfixes:
* Fix a file missing from build. (Critical fix)
0.10.4-0 (2013-11-24)
----------------------
Features:
* Remove dependency of es5-shim and es5-sham when using ES3.
0.10.3-0 (2013-11-24)
----------------------
Features:
* Improve performance of `Promise.method`
0.10.2-1 (2013-11-24)
----------------------
Features:
* Rename PromiseResolver#asCallback to PromiseResolver#callback
0.10.2-0 (2013-11-24)
----------------------
Features:
* Remove memoization of thenables
0.10.1-0 (2013-11-21)
----------------------
Features:
* Add methods `Promise.resolve()`, `Promise.reject()`, `Promise.defer()` and `.resolve()`.
0.10.0-1 (2013-11-17)
----------------------
0.10.0-0 (2013-11-17)
----------------------
Features:
* Implement `Promise.method()`
* Implement `.return()`
* Implement `.throw()`
Bugfixes:
* Fix promises being able to use themselves as resolution or follower value
0.9.11-1 (2013-11-14)
----------------------
Features:
* Implicit `Promise.all()` when yielding an array from generators
0.9.11-0 (2013-11-13)
----------------------
Bugfixes:
* Fix `.spread` not unwrapping thenables
0.9.10-2 (2013-11-13)
----------------------
Features:
* Improve performance of promisified functions on V8
Bugfixes:
* Report unhandled rejections even when long stack traces are disabled
* Fix `.error()` showing up in stack traces
0.9.10-1 (2013-11-05)
----------------------
Bugfixes:
* Catch filter method calls showing in stack traces
0.9.10-0 (2013-11-05)
----------------------
Bugfixes:
* Support primitives in catch filters
0.9.9-0 (2013-11-05)
---------------------
Features:
* Add `Promise.race()` and `.race()`
0.9.8-0 (2013-11-01)
---------------------
Bugfixes:
* Fix bug with `Promise.try` not unwrapping returned promises and thenables
0.9.7-0 (2013-10-29)
---------------------
Bugfixes:
* Fix bug with build files containing duplicated code for promise.js
0.9.6-0 (2013-10-28)
---------------------
Features:
* Improve output of reporting unhandled non-errors
* Implement RejectionError wrapping and `.error()` method
0.9.5-0 (2013-10-27)
---------------------
Features:
* Allow fresh copies of the library to be made
0.9.4-1 (2013-10-27)
---------------------
0.9.4-0 (2013-10-27)
---------------------
Bugfixes:
* Rollback non-working multiple fresh copies feature
0.9.3-0 (2013-10-27)
---------------------
Features:
* Allow fresh copies of the library to be made
* Add more components to customized builds
0.9.2-1 (2013-10-25)
---------------------
0.9.2-0 (2013-10-25)
---------------------
Features:
* Allow custom builds
0.9.1-1 (2013-10-22)
---------------------
Bugfixes:
* Fix unhandled rethrown exceptions not reported
0.9.1-0 (2013-10-22)
---------------------
Features:
* Improve performance of `Promise.try`
* Extend `Promise.try` to accept arguments and ctx to make it more usable in promisification of synchronous functions.
0.9.0-0 (2013-10-18)
---------------------
Features:
* Implement `.bind` and `Promise.bind`
Bugfixes:
* Fix `.some()` when argument is a pending promise that later resolves to an array
0.8.5-1 (2013-10-17)
---------------------
Features:
* Enable process wide long stack traces through BLUEBIRD\_DEBUG environment variable
0.8.5-0 (2013-10-16)
---------------------
Features:
* Improve performance of all collection methods
Bugfixes:
* Fix .finally passing the value to handlers
* Remove kew from benchmarks due to bugs in the library breaking the benchmark
* Fix some bluebird library calls potentially appearing in stack traces
0.8.4-1 (2013-10-15)
---------------------
Bugfixes:
* Fix .pending() call showing in long stack traces
0.8.4-0 (2013-10-15)
---------------------
Bugfixes:
* Fix PromiseArray and its sub-classes swallowing possibly unhandled rejections
0.8.3-3 (2013-10-14)
---------------------
Bugfixes:
* Fix AMD-declaration using named module.
0.8.3-2 (2013-10-14)
---------------------
Features:
* The mortals that can handle it may now release Zalgo by `require("bluebird/zalgo");`
0.8.3-1 (2013-10-14)
---------------------
Bugfixes:
* Fix memory leak when using the same promise to attach handlers over and over again
0.8.3-0 (2013-10-13)
---------------------
Features:
* Add `Promise.props()` and `Promise.prototype.props()`. They work like `.all()` for object properties.
Bugfixes:
* Fix bug with .some returning garbage when sparse arrays have rejections
0.8.2-2 (2013-10-13)
---------------------
Features:
* Improve performance of `.reduce()` when `initialValue` can be synchronously cast to a value
0.8.2-1 (2013-10-12)
---------------------
Bugfixes:
* Fix .npmignore having irrelevant files
0.8.2-0 (2013-10-12)
---------------------
Features:
* Improve performance of `.some()`
0.8.1-0 (2013-10-11)
---------------------
Bugfixes:
* Remove uses of dynamic evaluation (`new Function`, `eval` etc) when strictly not necessary. Use feature detection to use static evaluation to avoid errors when dynamic evaluation is prohibited.
0.8.0-3 (2013-10-10)
---------------------
Features:
* Add `.asCallback` property to `PromiseResolver`s
0.8.0-2 (2013-10-10)
---------------------
0.8.0-1 (2013-10-09)
---------------------
Features:
* Improve overall performance. Be able to sustain infinite recursion when using promises.
0.8.0-0 (2013-10-09)
---------------------
Bugfixes:
* Fix stackoverflow error when function calls itself "synchronously" from a promise handler
0.7.12-2 (2013-10-09)
----------------------
Bugfixes:
* Fix safari 6 not using `MutationObserver` as a scheduler
* Fix process exceptions interfering with internal queue flushing
0.7.12-1 (2013-10-09)
----------------------
Bugfixes:
* Don't try to detect if generators are available to allow shims to be used
0.7.12-0 (2013-10-08)
----------------------
Features:
* Promisification now consider all functions on the object and its prototype chain
* Individual promisifcation uses current `this` if no explicit receiver is given
* Give better stack traces when promisified callbacks throw or errback primitives such as strings by wrapping them in an `Error` object.
Bugfixes:
* Fix runtime APIs throwing synchronous errors
0.7.11-0 (2013-10-08)
----------------------
Features:
* Deprecate `Promise.promisify(Object target)` in favor of `Promise.promisifyAll(Object target)` to avoid confusion with function objects
* Coroutines now throw error when a non-promise is `yielded`
0.7.10-1 (2013-10-05)
----------------------
Features:
* Make tests pass Internet Explorer 8
0.7.10-0 (2013-10-05)
----------------------
Features:
* Create browser tests
0.7.9-1 (2013-10-03)
---------------------
Bugfixes:
* Fix promise cast bug when thenable fulfills using itself as the fulfillment value
0.7.9-0 (2013-10-03)
---------------------
Features:
* More performance improvements when long stack traces are enabled
0.7.8-1 (2013-10-02)
---------------------
Features:
* Performance improvements when long stack traces are enabled
0.7.8-0 (2013-10-02)
---------------------
Bugfixes:
* Fix promisified methods not turning synchronous exceptions into rejections
0.7.7-1 (2013-10-02)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.7-0 (2013-10-01)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.6-0 (2013-09-29)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.5-0 (2013-09-28)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.4-1 (2013-09-28)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.4-0 (2013-09-28)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.3-1 (2013-09-28)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.3-0 (2013-09-27)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.2-0 (2013-09-27)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.1-5 (2013-09-26)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.1-4 (2013-09-25)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.1-3 (2013-09-25)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.1-2 (2013-09-24)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.1-1 (2013-09-24)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.1-0 (2013-09-24)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.0-1 (2013-09-23)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.7.0-0 (2013-09-23)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.5-2 (2013-09-20)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.5-1 (2013-09-18)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.5-0 (2013-09-18)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.4-1 (2013-09-18)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.4-0 (2013-09-18)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.3-4 (2013-09-18)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.3-3 (2013-09-18)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.3-2 (2013-09-16)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.3-1 (2013-09-16)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.3-0 (2013-09-15)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.2-1 (2013-09-14)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.2-0 (2013-09-14)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.1-0 (2013-09-14)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.6.0-0 (2013-09-13)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-6 (2013-09-12)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-5 (2013-09-12)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-4 (2013-09-12)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-3 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-2 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-1 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.9-0 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.8-1 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.8-0 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.7-0 (2013-09-11)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.6-1 (2013-09-10)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.6-0 (2013-09-10)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.5-1 (2013-09-10)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.5-0 (2013-09-09)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.4-1 (2013-09-08)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.4-0 (2013-09-08)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.3-0 (2013-09-07)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.2-0 (2013-09-07)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.1-0 (2013-09-07)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.5.0-0 (2013-09-07)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.4.0-0 (2013-09-06)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.3.0-1 (2013-09-06)
---------------------
Features:
* feature
Bugfixes:
* bugfix
0.3.0 (2013-09-06)
-------------------
| programming_docs |
bluebird Why Performance? Why Performance?
================
> This article is partially or completely unfinished. You are welcome to create [pull requests](https://github.com/petkaantonov/bluebird/edit/master/docs/docs/why-performance.md) to help completing this article.
bluebird Async Dialogs Async Dialogs
=============
> This article is partially or completely unfinished. You are welcome to create [pull requests](https://github.com/petkaantonov/bluebird/edit/master/docs/docs/async-dialogs.md) to help completing this article.
Typically *promises* are used in conjunction with asynchronous tasks such as a network request or a `setTimeout`; a lesser explored use is dealing with user input. Since a program has to wait for a user to continue some actions it makes sense to consider it an asynchronous event.
For comparison I'll start with an example of a *synchronous* user interaction using `window.prompt` and then move to an *asynchronous* interaction by making our own DOM based prompt. To begin, here is a template for a simple HTML page:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Async Dislogs Example</title>
<script src="//cdn.jsdelivr.net/bluebird/3.7.2/bluebird.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var time = document.getElementById('time-stamp');
clockTick();
setInterval(clockTick, 1000);
function clockTick() {
time.innerHTML = new Date().toLocaleTimeString();
}
});
</script>
</head>
<body>
<p>The current time is <span id="time-stamp"></span>.</p>
<p>Your name is <span id="prompt"></span>.</p>
<button id="action">Set Name</button>
</body>
</html>
```
`window.prompt` blocks the web page from processing while it waits for the user to enter in data. It has to block because the input is returned and the next line of code needs that result. But for sake of this tutorial we are going to convert the typical conditional code into a promise API using a [promise constructor](api/new-promise).
```
function promptPromise(message) {
return new Promise(function(resolve, reject) {
var result = window.prompt(message);
if (result != null) {
resolve(result);
} else {
reject(new Error('User cancelled'));
}
});
}
var button = document.getElementById('action');
var output = document.getElementById('prompt');
button.addEventListener('click', function() {
promptPromise('What is your name?')
.then(function(name) {
output.innerHTML = String(name);
})
.catch(function() {
output.innerHTML = '¯\\_(ツ)_/¯';
});
});
```
[Run example on JSBin](http://jsbin.com/kowama/edit?js,output)
This doesn't add much much using `window.prompt`; however, one advantage is the API that promises provide. In the case where we call `promptPromise(…)` we can easily react to the result of the dialog without having to worry about how it is implemented. In our example we've implemented the `window.prompt` but our call to `promptPromise()` doesn't care. This makes a change to an *asynchronous* dialog a little more future proof.
To drive home the synchronous nature of the `window.prompt` notice that the time stops ticking when the prompt dialog is displayed. Let's fix that by making our own prompt. Since our dialog is just DOM manipulation the page won't be blocked while waiting for user input.
First add the prompt dialog to the HTML:
```
<style type="text/css">
#dialog {
width: 200px;
margin: auto;
padding: 10px;
border: thin solid black;
background: lightgreen;
}
.hidden {
display: none;
}
</style>
<div id="dialog" class="hidden">
<div class="message">foobar</div>
<input type="text">
<div>
<button class="ok">Ok</button>
<button class="cancel">Cancel</button>
</div>
</div>
```
We will want to keep the same API so our change will be only to the `promisePrompt`. It will find the dialog DOM elements, attach events to the elements, show the dialog box, return a promise that is resolved based on the attached events, and finally detaches the events and cleans up after itself (hiding the dialog box for another use later).
```
function promptPromise(message) {
var dialog = document.getElementById('dialog');
var input = dialog.querySelector('input');
var okButton = dialog.querySelector('button.ok');
var cancelButton = dialog.querySelector('button.cancel');
dialog.querySelector('.message').innerHTML = String(message);
dialog.className = '';
return new Promise(function(resolve, reject) {
dialog.addEventListener('click', function handleButtonClicks(e) {
if (e.target.tagName !== 'BUTTON') { return; }
dialog.removeEventListener('click', handleButtonClicks);
dialog.className = 'hidden';
if (e.target === okButton) {
resolve(input.value);
} else {
reject(new Error('User cancelled'));
}
});
});
}
```
[Run example on JSBin](http://jsbin.com/fucofu/edit?js,output)
Now when the user presses the **Set Name** button the clock continues to update while the dialog is visible.
Because the `removeEventListener` requires a reference to the original function that was used with the `addEventListener` it makes it difficult to clean up after itself without storing the references in a scope higher then the handler itself. Using a named function we can reference it when a user clicks the button. To help with performance and to avoid duplicating code the example uses [event delegation](https://davidwalsh.name/event-delegate) to capture both buttons in one *click* handler.
The same thing can be done with less code using jQuery's [event namespacing](https://api.jquery.com/on/#event-names).
```
return new Promise(function(resolve, reject) {
$('#okButton').on('click.promptDialog', function() {
resolve(input.value);
});
$('#cancelButton').on('click.promptDialog', reject);
})
.finally(function() {
$('#okButton').off('click.promptDialog');
$('#cancelButton').off('click.promptDialog');
});
```
There are still a few problems with the earlier code example. It feels like it is doing too much. A *squint* test reveals behavior for showing the dialog, set the dialog's message, attach two DOM events, construct a promise, event delegation, hide the dialog, and finally detach DOM events. That is a lot for one little function. A refactoring can help.
Abstraction is the key here. We will make an *object* (or class) that is responsible for managing the dialog box. Its interface will manage only two function references (callbacks): when the user clicks ok and when user clicks cancel. And it will offer the value when asked.
Using an abstraction like this the `promisePrompt` no longer needs to know anything about the DOM and concentrates on just providing a promise. This will also make things easier to create a promised version of a progress bar or confirmation dialog or any other type of UI that we want to have a value for. All we will need to do is write a class for that dialog type with the same interface and just pass that class into our promise making method.
The dialog interface might look like this:
```
var noop = function() {
return this;
};
function Dialog() {
this.setCallbacks(noop, noop);
}
Dialog.prototype.setCallbacks = function(okCallback, cancelCallback) {
this._okCallback = okCallback;
this._cancelCallback = cancelCallback;
return this;
};
Dialog.prototype.waitForUser = function() {
var _this = this;
return new Promise(function(resolve, reject) {
_this.setCallbacks(resolve, reject);
});
};
Dialog.prototype.show = noop;
Dialog.prototype.hide = noop;
```
Initially the Dialog class sets the two callbacks to *noop* functions. It is up to the child class to call them when necessary. We break down the promise creation to one function `waitForUser()` that sets the callbacks and returns a promise. At this level the `show()` and `hide()` are just *noop* functions as well and will be implemented by the child classes.
Our `PromptDialog` class is responsible for inheriting from `Dialog` and setting up the required DOM scaffolding and eventually call `this._okCallback` or `this._cancelCallback` as appropriate.
It might look like this:
```
function PromptDialog() {
Dialog.call(this);
this.el = document.getElementById('dialog');
this.inputEl = this.el.querySelector('input');
this.messageEl = this.el.querySelector('.message');
this.okButton = this.el.querySelector('button.ok');
this.cancelButton = this.el.querySelector('button.cancel');
this.attachDomEvents();
}
PromptDialog.prototype = Object.create(Dialog.prototype);
PromptDialog.prototype.attachDomEvents = function() {
var _this = this;
this.okButton.addEventListener('click', function() {
_this._okCallback(_this.inputEl.value);
});
this.cancelButton.addEventListener('click', function() {
_this._cancelCallback();
});
};
PromptDialog.prototype.show = function(message) {
this.messageEl.innerHTML = String(message);
this.el.className = '';
return this;
};
PromptDialog.prototype.hide = function() {
this.el.className = 'hidden';
return this;
};
```
Notice that use of `return this;` in most of the functions? That pattern will allow method chaining as you'll see shortly.
This inherits from `Dialog` and stores references to the required DOM elements that this dialog uses. It then attaches the require DOM events (`attachDomEvents()`) which eventually call the callbacks. Then it implements the `show()` and `hide()` methods. Its usage is more flexible and verbose:
```
var output = document.getElementById('prompt');
var prompt = new PromptDialog();
prompt.show('What is your name?')
.waitForUser()
.then(function(name) {
output.innerHTML = String(name);
})
.catch(function() {
output.innerHTML = '¯\\_(ツ)_/¯';
})
.finally(function() {
prompt.hide();
});
```
[Run example on JSBin](http://jsbin.com/wupixi/edit?js,output)
This abstraction can be expanded on in other ways. For example a notification dialog:
```
function NotifyDialog() {
Dialog.call(this);
var _this = this;
this.el = document.getElementById('notify-dialog');
this.messageEl = this.el.querySelector('.message');
this.okButton = this.el.querySelector('button.ok');
this.okButton.addEventListener('click', function() {
_this._okCallback();
});
}
NotifyDialog.prototype = Object.create(Dialog.prototype);
NotifyDialog.prototype.show = function(message) {
this.messageEl.innerHTML = String(message);
this.el.className = '';
return this;
};
NotifyDialog.prototype.show = function() {
this.el.className = 'hidden';
return this;
};
```
#### Exercises for the student
1. Write a function that takes a `Dialog` instance and a default value. Have it return a promise that resolves to the default value if the user clicks cancel.
2. With the use of abstract classes can the similarities between `PromptDialog` and `NotifyDialog` be abstracted? Make a sub class of `Dialog` that abstracts the common DOM code (`DOMDialog`). Then refactor the `PromptDialog` and `NotifyDialog` to inherate from `DOMDialog` but references the correct DOM selectors.
Cancellation
-------------
Something missing from the above example is proper error handling. When it comes to promises it is a best practise to always *reject a promise with an Error* and not with plain data such as an object, string, number, or null/undefined. The reasoning for this is promises are best used as a way to regain some of the syntax you have with the standard `try {} catch() {}` blocks with asynchronous code.
An advantage of using `Error`s is the ability to test why a promise was rejected and make decisions on that. This ability is also baked into how Bluebird works. You can pass in a predicate to the `catch()` block allowing you to have more than one block based on what `Error` it was rejected with. For example:
```
doSomething().then(function(value) {
// Do something with value or fail with an error.
throw new Error('testing errors');
})
.catch(ArgumentError, function(e) {
console.log('You buggered up something with the arguments.', e);
})
.catch(SyntaxError, function(e) {
console.log('Check your syntax!', e);
})
.catch(function(e) {
// e is an Error object.
console.log('Well something genaric happened.', e);
});
```
In our dialog example perhaps we want to differentiate between a rejected promise because of some problem (bad AJAX, programming error, etc.) or because the user pressed the cancel button.
To do this we will have two `catch()` functions one for `UserCanceledError` and one for any other `Error`. We can make a custom error like so:
```
function UserCanceledError() {
this.name = 'UserCanceledError';
this.message = 'Dialog cancelled';
}
UserCanceledError.prototype = Object.create(Error.prototype);
```
See [this StackOverflow answer](http://stackoverflow.com/a/17891099/227176) for a more detailed and feature complete way to make custom errors.
Now we can add a `cancel()` reject with this in our event listener:
```
Dialog.prototype.cancel = function() {
this._cancelCallback(new UserCanceledError());
};
…
PromptDialog.prototype.attachDomEvents = function() {
var _this = this;
this.okButton.addEventListener('click', function() {
_this._okCallback(_this.inputEl.value);
});
this.cancelButton.addEventListener('click', function() {
_this.cancel();
});
};
```
And in our usage case we can test for it:
```
// Timeout the dialog in five seconds.
setTimeout(function() { prompt.cancel(); }, 5000);
prompt.show('What is your name?')
.waitForUser()
.then(function(name) {
output.innerHTML = String(name);
})
.catch(UserCanceledError, function() {
output.innerHTML = '¯\\_(ツ)_/¯';
})
.catch(function(e) {
console.log('Something bad happened!', e);
})
.finally(function() {
prompt.hide();
});
```
[Run example on JSBin](http://jsbin.com/yaropo/edit?js,output)
**NOTE:** Bluebird supports [cancellation](api/cancellation) as an optional feature that is turned off by default. However, its implementation (since version 3.0) is meant to stop the then and catch callbacks from firing. It is not helpful in the example of a user cancellation as described here.
Progress bar
-------------
When there are asynchronous tasks that have the ability to notify progress as they complete it can be tempting to want that in the promise that represents that task. Unfortunately this is a bit of an anti-pattern. That is because the point of promises is to represent a value as if it was natural (like it is in normal synchronous code) and not to be over glorified callback management.
So how then could we represent a progress bar like dialog? Well the answer is to manage the progress through callbacks outside the promise API. Bluebird has since [deprecated the progression feature](deprecated-apis#progression) and offers an alternative which I hope to illustrate here.
Another key difference between a *progress bar* dialog and any other dialog we've discussed here is that a progress bar represents information on another task and *not* user import. Instead of the program waiting for the user to provide a value the dialog box is waiting on the program to provide a value (resolved: 100% complete, rejected: aborted half way through). Because of this the *progress bar* dialog would have a different interface then the previous dialogs we've covered. However, there can still be some user interaction so in essence we are dealing with two promises.
Bluebird has a way to manage more than one promise simultaneously. When you want to know if more then one promise completes there is a `Promise.all()` function that takes an array of promises and returns a new promise waiting for them all to resolve. But if any one is rejected the returned promise is immediately rejected.
Bluebird also has a `Promise.race()` function which does the same thing but doesn't wait for all of them to finish. That is what we want. An example how this might look:
```
function showProgress(otherPromise) {
var progress = new ProgressbarDialog().show('Uploading…');
return Promise.race([otherPromise, promise.waitForUser()])
.finally(function() {
progress.hide();
});
}
```
Here is some example HTML for the Progress Dialog:
```
<style type="text/css">
#progress-dialog {
width: 200px;
margin: auto;
border: thin solid black;
padding: 10px;
background: lightgreen;
}
#progress-dialog .progress-bar {
border: 1px solid black;
margin: 10px auto;
padding: 0;
height: 20px;
}
#progress-dialog .progress-bar>div {
background-color: blue;
margin: 0;
padding: 0;
border: none;
height: 20px;
}
</style>
<div id="progress-dialog">
<div class="message"></div>
<div class="progress-bar"><div></div></div>
<div>
<button class="cancel">Cancel</button>
</div>
</div>
```
The JavaScript is the same as the `PromptDialog` only we will add a `setProgress()` method:
```
function ProgressDialog() {
Dialog.call(this);
this.el = document.getElementById('progress-dialog');
this.messageEl = this.el.querySelector('.message');
this.progressBar = this.el.querySelector('.progress-bar>div');
this.cancelButton = this.el.querySelector('button.cancel');
this.attachDomEvents();
}
ProgressDialog.prototype = Object.create(Dialog.prototype);
ProgressDialog.prototype.attachDomEvents = function() {
var _this = this;
this.cancelButton.addEventListener('click', function() {
_this.cancel();
});
};
ProgressDialog.prototype.show = function(message) {
this.messageEl.innerHTML = String(message);
this.el.className = '';
return this;
};
ProgressDialog.prototype.hide = function() {
this.el.className = 'hidden';
return this;
};
ProgressDialog.prototype.setProgress = function(percent) {
this.progressBar.style.width = percent + '%';
};
```
A common misconception is that promises are a form of callback management. This is not the case and is why the idea of having a progress callback is not part of the Promise spec. However, much like the Promise library passes in a `resolve` and `reject` callback when you create a new promise (`new Promise(…)`) we can do the same patter for a progress callback.
Now to the fun part. For this tutorial we will *fake* a lengthy file upload by using `setTimeout`. The intent is to provide a promise and to allow a progress to be periodically ticked away. We will expect a function to be passed which is called whenever the progress needs updating. And it returns a promise.
```
function delayedPromise(progressCallback) {
var step = 10;
return new Promise(function(resolve, reject) {
var progress = 0 - step; // So first run of nextTick will set progress to 0
function nextTick() {
if (progress >= 100 ) {
resolve('done');
} else {
progress += step;
progressCallback(progress);
setTimeout(nextTick, 500);
}
}
nextTick();
});
}
```
When we construct our `ProgressDialog` we use the `waitForUser()` method to capture the user interaction promise and then use `delayedPromise()` to capture the fake network promise and finally `Promise.reace()` to manage the two simultaneously and end with a single promise as usual.
```
document.addEventListener('DOMContentLoaded', function() {
var button = document.getElementById('action');
var output = document.getElementById('output');
var prompt = new ProgressDialog();
button.addEventListener('click', function() {
var pendingProgress = true;
var waitForPromise = delayedPromise(function(progress) {
if (pendingProgress) {
prompt.setProgress(progress);
}
});
// Prevent user from pressing button while dialog is visible.
button.disabled = true;
prompt.show('Simulating a file upload.');
Promise.race([waitForPromise, prompt.waitForUser()])
.then(function() {
output.innerHTML = 'Progress completed';
})
.catch(UserCanceledError, function() {
output.innerHTML = 'Progress canceled by user';
})
.catch(function(e) {
console.log('Error', e);
})
.finally(function() {
pendingProgress = false;
button.disabled = false;
prompt.hide();
});
});
});
```
[Run example on JSBin](http://jsbin.com/bipeve/edit?js,output)
I hope this helps illustrate some concepts available with Promises and a different perspective on how promises can represent more then just AJAX data.
Although the code may look verbose it does provide the benefit that it is modular and can be easily changed. A trait difficult to achieve with a more procedural style.
Happy coding, [@sukima](https://github.com/sukima).
| programming_docs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.