컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 채우다
#include <array_ops.h>
스칼라 값으로 채워진 텐서를 생성합니다.
요약
이 작업은 모양의 dims
텐서를 생성하고 value
으로 채웁니다.
예를 들어:
# Output tensor has shape [2, 3].
fill([2, 3], 9) ==> [[9, 9, 9]
[9, 9, 9]]
tf.fill
몇 가지 면에서 tf.constant
와 다릅니다.
-
tf.fill
스칼라 내용만 지원하는 반면 tf.constant
Tensor 값을 지원합니다. -
tf.fill
런타임에 실제 Tensor 값을 구성하는 계산 그래프에 Op를 생성합니다. 이는 Const
노드를 사용하여 전체 Tensor를 그래프에 포함하는 tf.constant
와 대조됩니다. -
tf.fill
그래프 런타임에서 평가하기 때문에 tf.constant
와 달리 다른 런타임 Tensor를 기반으로 하는 동적 모양을 지원합니다.
인수:
- 범위: 범위 개체
- 희미함: 1-D. 출력 텐서의 모양을 나타냅니다.
- 값: 0-D(스칼라). 반환된 텐서를 채울 값입니다.
(numpy) np.full과 동일
보고:
공개 속성
공공 기능
마디
::tensorflow::Node * node() const
operator::tensorflow::Input() const
연산자::텐서플로우::출력
operator::tensorflow::Output() const
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# tensorflow::ops::Fill Class Reference\n\ntensorflow::ops::Fill\n=====================\n\n`#include \u003carray_ops.h\u003e`\n\nCreates a tensor filled with a scalar value.\n\nSummary\n-------\n\nThis operation creates a tensor of shape `dims` and fills it with `value`.\n\nFor example:\n\n\n```text\n# Output tensor has shape [2, 3].\nfill([2, 3], 9) ==\u003e [[9, 9, 9]\n [9, 9, 9]]\n```\n\n\u003cbr /\u003e\n\n`tf.fill` differs from `tf.constant` in a few ways:\n\n\n- `tf.fill` only supports scalar contents, whereas `tf.constant` supports [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) values.\n- `tf.fill` creates an Op in the computation graph that constructs the actual [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) value at runtime. This is in contrast to `tf.constant` which embeds the entire [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) into the graph with a `Const` node.\n- Because `tf.fill` evaluates at graph runtime, it supports dynamic shapes based on other runtime Tensors, unlike `tf.constant`.\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- dims: 1-D. Represents the shape of the output tensor.\n- value: 0-D (scalar). Value to fill the returned tensor.\n\n\u003cbr /\u003e\n\n(numpy) Equivalent to np.full\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The output tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Fill](#classtensorflow_1_1ops_1_1_fill_1a01c1c041aa66636af36c215a28cad8f8)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` dims, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_fill_1ab58dad131aa0ced03a7b508cb5f17ee8) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_fill_1af59efc826ad951c4bb994ccf186b0e3c) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_fill_1a470a2e887eb44734252766d0f4759b04)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fill_1a7eb9e821e29fbfa81a25dd5ae382ce1f)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fill_1a952032189c0e55332094cc69e197ae06)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### Fill\n\n```gdscript\n Fill(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input dims,\n ::tensorflow::Input value\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]