Stay organized with collections
Save and categorize content based on your preferences.
#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
Public functions
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-11-15 UTC.
[null,null,["Last updated 2021-11-15 UTC."],[],[],null,["# tensorflow::Input::Initializer Struct Reference\n\ntensorflow::Input::Initializer\n==============================\n\n`#include \u003cops.h\u003e`\n\n[Initializer](/api_docs/cc/struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer) enables constructing an [Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input) object from various kinds of C++ constants such as simple primitive constants and nested initializer lists representing a multi-dimensional array.\n\nSummary\n-------\n\n[Initializer](/api_docs/cc/struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer) constructors are all templates, so the aforementioned kinds of C++ constants can be used to construct an [Initializer](/api_docs/cc/struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer). [Initializer](/api_docs/cc/struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer) stores the value it got constructed with in a [Tensor](/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) object.\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Initializer](#structtensorflow_1_1_input_1_1_initializer_1ade60a4fdcfa9a530604fbf39d3b5be12)`(const T & v)` Construct from a scalar value of an arithmetic type or a type that can be converted to a string (eg. ||\n| [Initializer](#structtensorflow_1_1_input_1_1_initializer_1a9314222b3303dcf97314a4bcbcaa94ad)`(const `[Tensor](/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)` & t)` ||\n| [Initializer](#structtensorflow_1_1_input_1_1_initializer_1ab77d0712180868a7311936ca9a034835)`(const T & v, const TensorShape & shape)` Construct from a scalar value and an explicit shape. ||\n| [Initializer](#structtensorflow_1_1_input_1_1_initializer_1a91bd52431434dc5358ae8aa39070fe5f)`(const std::initializer_list\u003c T \u003e & v)` Construct from a initializer list of scalars (a one-dimensional tensor). ||\n| [Initializer](#structtensorflow_1_1_input_1_1_initializer_1a3f572c2835a2310e2d5c28138e69ae76)`(const std::initializer_list\u003c T \u003e & v, const TensorShape & shape)` Construct from a initializer list of scalars and an explicit shape. ||\n| [Initializer](#structtensorflow_1_1_input_1_1_initializer_1a8099f954da757c77ac7d8e1c32df88ce)`(const std::initializer_list\u003c `[Initializer](/api_docs/cc/struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer)` \u003e & v)` Construct a multi-dimensional tensor from a nested initializer list. ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| [status](#structtensorflow_1_1_input_1_1_initializer_1af0ab9526e575fd7d4b9d5f7dbabcb7e4) | `Status` |\n| [tensor](#structtensorflow_1_1_input_1_1_initializer_1a7b520438780dc80f0162a480a3cadb74) | [Tensor](/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------|---------------|\n| [AsTensorProto](#structtensorflow_1_1_input_1_1_initializer_1a6b1e360b983fec2140b756971fe7699d)`()` | `TensorProto` |\n\nPublic attributes\n-----------------\n\n### status\n\n```text\nStatus tensorflow::Input::Initializer::status\n``` \n\n### tensor\n\n```text\nTensor tensorflow::Input::Initializer::tensor\n``` \n\nPublic functions\n----------------\n\n### AsTensorProto\n\n```text\nTensorProto tensorflow::Input::Initializer::AsTensorProto()\n``` \n\n### Initializer\n\n```gdscript\n tensorflow::Input::Initializer::Initializer(\n const T & v\n)\n``` \nConstruct from a scalar value of an arithmetic type or a type that can be converted to a string (eg.\n\na string literal). \n\n### Initializer\n\n```gdscript\n tensorflow::Input::Initializer::Initializer(\n const Tensor & t\n)\n``` \n\n### Initializer\n\n```gdscript\n tensorflow::Input::Initializer::Initializer(\n const T & v,\n const TensorShape & shape\n)\n``` \nConstruct from a scalar value and an explicit shape. \n\n### Initializer\n\n```gdscript\n tensorflow::Input::Initializer::Initializer(\n const std::initializer_list\u003c T \u003e & v\n)\n``` \nConstruct from a initializer list of scalars (a one-dimensional tensor). \n\n### Initializer\n\n```gdscript\n tensorflow::Input::Initializer::Initializer(\n const std::initializer_list\u003c T \u003e & v,\n const TensorShape & shape\n)\n``` \nConstruct from a initializer list of scalars and an explicit shape. \n\n### Initializer\n\n```gdscript\n tensorflow::Input::Initializer::Initializer(\n const std::initializer_list\u003c Initializer \u003e & v\n)\n``` \nConstruct a multi-dimensional tensor from a nested initializer list.\n\nNote 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."]]