컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: MatrixBandPart
#include <array_ops.h>
각 가장 안쪽 행렬의 중앙 밴드 외부에 있는 모든 항목을 설정하는 텐서를 복사합니다.
요약
0으로.
band
부분은 다음과 같이 계산됩니다. input
k
차원 [I, J, K, ..., M, N]
이 있다고 가정하면 출력은 동일한 모양의 텐서입니다.
band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]
.
표시기 기능
in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper)
.
예를 들어:
# if 'input' is [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[-2, -1, 0, 1]
[-3, -2, -1, 0]],
tf.matrix_band_part(input, 1, -1) ==> [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[ 0, -1, 0, 1]
[ 0, 0, -1, 0]],
tf.matrix_band_part(input, 2, 1) ==> [[ 0, 1, 0, 0]
[-1, 0, 1, 0]
[-2, -1, 0, 1]
[ 0, -2, -1, 0]]
유용한 특수 사례:
tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
tf.matrix_band_part(input, 0, 0) ==> Diagonal.
인수:
- 범위: 범위 개체
- 입력: 순위
k
텐서. - num_lower: 0차원 텐서. 유지할 하부대각선의 수입니다. 음수인 경우 아래쪽 삼각형 전체를 유지합니다.
- num_upper: 0차원 텐서. 유지할 상부대각선의 수입니다. 음수인 경우 전체 위쪽 삼각형을 유지합니다.
보고:
-
Output
: 입력과 동일한 모양의 순위 k
텐서. 추출된 줄무늬 텐서.
공개 속성
공공 기능
마디
::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-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# tensorflow::ops::MatrixBandPart Class Reference\n\ntensorflow::ops::MatrixBandPart\n===============================\n\n`#include \u003carray_ops.h\u003e`\n\nCopy a tensor setting everything outside a central band in each innermost matrix.\n\nSummary\n-------\n\nto zero.\n\nThe `band` part is computed as follows: Assume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a tensor with the same shape where\n\n`band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]`.\n\nThe indicator function\n\n`in_band(m, n) = (num_lower \u003c 0 || (m-n) \u003c= num_lower)) && (num_upper \u003c 0 || (n-m) \u003c= num_upper)`.\n\nFor example:\n\n\n```text\n# if 'input' is [[ 0, 1, 2, 3]\n [-1, 0, 1, 2]\n [-2, -1, 0, 1]\n [-3, -2, -1, 0]],\n```\n\n\u003cbr /\u003e\n\n\n```scdoc\ntf.matrix_band_part(input, 1, -1) ==\u003e [[ 0, 1, 2, 3]\n [-1, 0, 1, 2]\n [ 0, -1, 0, 1]\n [ 0, 0, -1, 0]],\n```\n\n\u003cbr /\u003e\n\n\n```scdoc\ntf.matrix_band_part(input, 2, 1) ==\u003e [[ 0, 1, 0, 0]\n [-1, 0, 1, 0]\n [-2, -1, 0, 1]\n [ 0, -2, -1, 0]]\n```\n\n\u003cbr /\u003e\n\nUseful special cases:\n\n\n```scdoc\n tf.matrix_band_part(input, 0, -1) ==\u003e Upper triangular part.\n tf.matrix_band_part(input, -1, 0) ==\u003e Lower triangular part.\n tf.matrix_band_part(input, 0, 0) ==\u003e Diagonal.\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: Rank `k` tensor.\n- num_lower: 0-D tensor. Number of subdiagonals to keep. If negative, keep entire lower triangle.\n- num_upper: 0-D tensor. Number of superdiagonals to keep. If negative, keep entire upper triangle.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Rank `k` tensor of the same shape as input. The extracted banded tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [MatrixBandPart](#classtensorflow_1_1ops_1_1_matrix_band_part_1aafbd4f5790f99aabe649a2603fab5026)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` num_lower, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` num_upper)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [band](#classtensorflow_1_1ops_1_1_matrix_band_part_1a19ddd7640d84cfeb55298dcd2d150a8c) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_matrix_band_part_1a7f11fcb9cf1a97f13cded627a9579305) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_matrix_band_part_1a7a9ecf47b2def85ed1a8e7ab08dfe008)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_band_part_1a1b6a750bbd105a89c4ef9a398ccf7cf1)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_band_part_1a2be19e72aeddcea40f0be7cc6d6fdf97)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### band\n\n```text\n::tensorflow::Output band\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### MatrixBandPart\n\n```gdscript\n MatrixBandPart(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input num_lower,\n ::tensorflow::Input num_upper\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```"]]