Creates a tensor filled with a scalar value.
Compat aliases for migration
See Migration guide for more details.
tf.raw_ops.Fill( dims, value, name=None )
This operation creates a tensor of shape
dims and fills it with
# Output tensor has shape [2, 3]. fill([2, 3], 9) ==> [[9, 9, 9] [9, 9, 9]]
tf.fillonly supports scalar contents, whereas
tf.constantsupports Tensor values.
tf.fillcreates an Op in the computation graph that constructs the actual Tensor value at runtime. This is in contrast to
tf.constantwhich embeds the entire Tensor into the graph with a
tf.fillevaluates at graph runtime, it supports dynamic shapes based on other runtime Tensors, unlike
| || A |
| || A |
| ||A name for the operation (optional).|
| A |
Equivalent to np.full
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.