tensorflow::Input::Initializer

#include <ops.h>

Initializer enables constructing an Input object from various kinds of C++ constants such as simple primitive constants and nested initializer lists representing a multi-dimensional array.

Summary

Initializer constructors are all templates, so the aforementioned kinds of C++ constants can be used to construct an Initializer. Initializer stores the value it got constructed with in a Tensor object.

Constructors and Destructors
Initializer(const T & v)
Construct from a scalar value of an arithmetic type or a type that can be converted to a string (eg.
Initializer(const Tensor & t)
Initializer(const T & v, const TensorShape & shape)
Construct from a scalar value and an explicit shape.
Initializer(const std::initializer_list< T > & v)
Construct from a initializer list of scalars (a one-dimensional tensor).
Initializer(const std::initializer_list< T > & v, const TensorShape & shape)
Construct from a initializer list of scalars and an explicit shape.
Initializer(const std::initializer_list< Initializer > & v)
Construct a multi-dimensional tensor from a nested initializer list.
Public attributes
status
Status
tensor
Public functions
AsTensorProto()
TensorProto

Public attributes

status

Status tensorflow::Input::Initializer::status

tensor

Tensor tensorflow::Input::Initializer::tensor

Public functions

AsTensorProto

TensorProto tensorflow::Input::Initializer::AsTensorProto()

Initializer

 tensorflow::Input::Initializer::Initializer(
  const T & v
)

Construct from a scalar value of an arithmetic type or a type that can be converted to a string (eg.

a string literal).

Initializer

 tensorflow::Input::Initializer::Initializer(
  const Tensor & t
)

Initializer

 tensorflow::Input::Initializer::Initializer(
  const T & v,
  const TensorShape & shape
)

Construct from a scalar value and an explicit shape.

Initializer

 tensorflow::Input::Initializer::Initializer(
  const std::initializer_list< T > & v
)

Construct from a initializer list of scalars (a one-dimensional tensor).

Initializer

 tensorflow::Input::Initializer::Initializer(
  const std::initializer_list< T > & v,
  const TensorShape & shape
)

Construct from a initializer list of scalars and an explicit shape.

Initializer

 tensorflow::Input::Initializer::Initializer(
  const std::initializer_list< Initializer > & v
)

Construct a multi-dimensional tensor from a nested initializer list.

Note that C++ syntax allows nesting of arbitrarily typed initializer lists, so such invalid initializers cannot be disallowed at compile time. This function performs checks to make sure that the nested initializer list is indeed a valid multi-dimensional tensor.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/input/initializer