`#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.

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` | |

`tensor` |

Public functions | |
---|---|

`AsTensorProto()` | `TensorProto` |

Status tensorflow::Input::Initializer::status

Tensor tensorflow::Input::Initializer::tensor

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

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).

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

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

Construct from a scalar value and an explicit shape.

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

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

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

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

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.

© 2018 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/api_docs/cc/struct/tensorflow/input/initializer.html