T
- data type for ref()
output@Operator public final class Variable<T> extends PrimitiveOp implements Operand<T>
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.
Modifier and Type | Class and Description |
---|---|
static class |
Variable.Options
Optional attributes for
Variable |
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static Variable.Options |
container(String container) |
static <T> Variable<T> |
create(Scope scope,
Shape shape,
Class<T> dtype,
Variable.Options... options)
Factory method to create a class wrapping a new Variable operation.
|
Output<T> |
ref()
A reference to the variable tensor.
|
static Variable.Options |
sharedName(String sharedName) |
equals, hashCode, op, toString
public static <T> Variable<T> create(Scope scope, Shape shape, Class<T> dtype, Variable.Options... options)
scope
- current scopeshape
- The shape of the variable tensor.dtype
- The type of elements in the variable tensor.options
- carries optional attributes valuespublic static Variable.Options container(String container)
container
- If non-empty, this variable is placed in the given container.
Otherwise, a default container is used.public static Variable.Options sharedName(String sharedName)
sharedName
- If non-empty, this variable is named in the given bucket
with this shared_name. Otherwise, the node name is used instead.public Output<T> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<T>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.