@Operator public final class TensorArray extends PrimitiveOp
Write data via Write and read via Read or Pack.
Modifier and Type | Class and Description |
---|---|
static class |
TensorArray.Options
Optional attributes for
TensorArray |
operation
Modifier and Type | Method and Description |
---|---|
static TensorArray.Options |
clearAfterRead(Boolean clearAfterRead) |
static <T> TensorArray |
create(Scope scope,
Operand<Integer> size,
Class<T> dtype,
TensorArray.Options... options)
Factory method to create a class wrapping a new TensorArray operation.
|
static TensorArray.Options |
dynamicSize(Boolean dynamicSize) |
static TensorArray.Options |
elementShape(Shape elementShape) |
Output<Float> |
flow()
A scalar used to control gradient flow.
|
Output<?> |
handle()
The handle to the TensorArray.
|
static TensorArray.Options |
identicalElementShapes(Boolean identicalElementShapes) |
static TensorArray.Options |
tensorArrayName(String tensorArrayName) |
equals, hashCode, op, toString
public static <T> TensorArray create(Scope scope, Operand<Integer> size, Class<T> dtype, TensorArray.Options... options)
scope
- current scopesize
- The size of the array.dtype
- The type of the elements on the tensor_array.options
- carries optional attributes valuespublic static TensorArray.Options elementShape(Shape elementShape)
elementShape
- The expected shape of an element, if known. Used to
validate the shapes of TensorArray elements. If this shape is not
fully specified, gathering zero-size TensorArrays is an error.public static TensorArray.Options dynamicSize(Boolean dynamicSize)
dynamicSize
- A boolean that determines whether writes to the TensorArray
are allowed to grow the size. By default, this is not allowed.public static TensorArray.Options clearAfterRead(Boolean clearAfterRead)
clearAfterRead
- If true (default), Tensors in the TensorArray are cleared
after being read. This disables multiple read semantics but allows early
release of memory.public static TensorArray.Options identicalElementShapes(Boolean identicalElementShapes)
identicalElementShapes
- If true (default is false), then all
elements in the TensorArray will be expected to have have identical shapes.
This allows certain behaviors, like dynamically checking for
consistent shapes on write, and being able to fill in properly
shaped zero tensors on stack -- even if the element_shape attribute
is not fully defined.public static TensorArray.Options tensorArrayName(String tensorArrayName)
tensorArrayName
- Overrides the name used for the temporary tensor_array
resource. Default value is the name of the 'TensorArray' op (which
is guaranteed unique).public Output<?> handle()
Copyright © 2022. All rights reserved.