T
- constant type@Operator public class Zeros<T> extends Object implements Op, Operand<T>
For example, the following expression
ops.zeros(ops.constant(new long[]{2, 2}), Float.class)is the equivalent of
{@code ops.fill(ops.constant(new long[]{2, 2}), ops.constant(0.0f))
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T,U extends Number> |
create(Scope scope,
Operand<U> dims,
Class<T> type)
Creates a zeroed tensor given its type and shape.
|
public static <T,U extends Number> Zeros<T> create(Scope scope, Operand<U> dims, Class<T> type)
scope
- is a scope used to add the underlying operationdims
- a 1-D operand that represents the shape of the output tensortype
- the output tensor datatypeIllegalArgumentException
- if the tensor type or shape cannot be initialized with zeros.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.