Default caching device passed to getVariable
.
Default data type passed to getVariable
.
Gets an existing partitioned variable with the specified name or creates a new one.
Gets an existing partitioned variable with the specified name or creates a new one.
Variable store currently being used to store variables.
Variable name.
Variable data type.
Variable shape.
Variable initializer. If initializer
is null
(the default), the default initializer
passed in the constructor is used. If that one is null
too, then we use a new
glorotUniformInitializer
. The initializer will be called for each part of the partitioned
variable separately.
Variable regularizer.
Function that accepts a fully defined Shape
and returns a sequence of integers (i.e., the
partitions
). These integers describe how to partition the given variable, along the each
dimension. That is, partitions(1) = 3
means that we split the variable into 3
parts
along dimension 1
. Currently, partitioning along only a single axis is supported.
If true
, the default, the variable is added to the graph collection
Graph.Keys.TRAINABLE_VARIABLES
. This collection is used as the default set of variables
to use by the optimizers.
Reuse value indicating whether to re-use an existing variable with the same name, create a new variable, or do either.
Set of graph collections keys. The variable is added to these collections. Defaults to
Set(Graph.Keys.GLOBAL_VARIABLES)
.
Device specification describing where the variable should be cached for reading. Defaults
to the variable's device. Typical use is to cache on the device where the ops using the
variable reside, to deduplicate copying through Switch
and other conditional statements.
Requested variable.
IllegalArgumentException
If any of the provided arguments are not compatible with each other, or with the
variables stored in this variable store.
InvalidDataTypeException
If the provided data type does not match the data type of the corresponding
variable stored in this variable store (if there exists one).
ShapeMismatchException
If the provided shape does not match the shape of the corresponding variable
stored in this variable store (if there exists one).
Gets an existing variable with the specified name or creates a new one.
Gets an existing variable with the specified name or creates a new one.
Variable store currently being used to store variables.
Variable name.
Variable data type.
Variable shape.
Variable initializer. If initializer
is null
(the default), the default initializer
passed in the constructor is used. If that one is null
too, then we use a new
glorotUniformInitializer
. The initializer will be called for each part of the partitioned
variable separately.
Variable regularizer.
If true
, the default, the variable is added to the graph collection
Graph.Keys.TRAINABLE_VARIABLES
. This collection is used as the default set of variables
to use by the optimizers.
Reuse value indicating whether to re-use an existing variable with the same name, create a new variable, or do either.
reuse
is null
(the default), both new and existing variables are returned.Set of graph collections keys. The variable is added to these collections. Defaults to
Set(Graph.Keys.GLOBAL_VARIABLES)
.
Device specification describing where the variable should be cached for reading. Defaults
to the variable's device. Typical use is to cache on the device where the ops using the
variable reside, to deduplicate copying through Switch
and other conditional statements.
Requested variable.
IllegalArgumentException
If any of the provided arguments are not compatible with each other, or with the
variables stored in this variable store.
InvalidDataTypeException
If the provided data type does not match the data type of the corresponding
variable stored in this variable store (if there exists one).
ShapeMismatchException
If the provided shape does not match the shape of the corresponding variable
stored in this variable store (if there exists one).
Default initializer passed to getVariable
.
Name of the variable scope, used as a prefix in getVariable
.
Default name scope passed to getVariable
.
Default partitioner passed to getVariable
.
Default regularizer passed to getVariable
.
Reuse value indicating whether to re-use an existing variable with the same name, create a new variable, or do either.
Default underlying variable getter passed to getVariable
.
Variable scope that carries default settings to provide to
getVariable
.A variable scope allows to create new variables and to share already created ones while providing checks to not create or share by accident.
Many of the arguments we need for
getVariable
in a variable store are most easily handled with a context. VariableScope objects are used for the defaults.