コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦:: ArgMax
#include <math_ops.h>
テンソルの次元全体で最大値を持つインデックスを返します。
まとめ
同点の場合、戻り値の同一性は保証されないことに注意してください。
使用法:
import tensorflow as tf
a = [1, 10, 26.9, 2.8, 166.32, 62.3]
b = tf.math.argmax(input = a)
c = tf.keras.backend.eval(b)
# c = 4
# here a[4] = 166.32 which is the largest element of a across axis 0
引数:
- スコープ:スコープオブジェクト
- ディメンション: int32 または int64、
[-rank(input), rank(input))
の範囲内である必要があります。入力テンソルのどの次元を削減するかを記述します。ベクトルの場合は、次元 = 0 を使用します。
戻り値:
パブリック属性
公共機能
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
出力タイプ
Attrs OutputType(
DataType x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],null,["# tensorflow::ops::ArgMax Class Reference\n\ntensorflow::ops::ArgMax\n=======================\n\n`#include \u003cmath_ops.h\u003e`\n\nReturns the index with the largest value across dimensions of a tensor.\n\nSummary\n-------\n\nNote that in case of ties the identity of the return value is not guaranteed.\n\nUsage: \n\n```python\n import tensorflow as tf\n a = [1, 10, 26.9, 2.8, 166.32, 62.3]\n b = tf.math.argmax(input = a)\n c = tf.keras.backend.eval(b)\n # c = 4\n # here a[4] = 166.32 which is the largest element of a across axis 0\n \n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- dimension: int32 or int64, must be in the range `[-rank(input), rank(input))`. Describes which dimension of the input [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) to reduce across. For vectors, use dimension = 0.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The output tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ArgMax](#classtensorflow_1_1ops_1_1_arg_max_1abfe8a95c471e85d0f404f93189a3d616)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` dimension)` ||\n| [ArgMax](#classtensorflow_1_1ops_1_1_arg_max_1a534c4b1988d0fe5c5150338c42c115b2)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` dimension, const `[ArgMax::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/arg-max/attrs#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_arg_max_1a60663c9ffb26ff3cb9dc201881e87a3a) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_arg_max_1a2e1f5ef358c10195be899e08e0a3b46c) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_arg_max_1ad8106e00a969b5bb5791dd57f0831f26)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_arg_max_1accba38db65bed3a37b5872a4d19b5dae)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_arg_max_1a1620a09f5066f00dc88f6ed91b70cd37)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|\n| [OutputType](#classtensorflow_1_1ops_1_1_arg_max_1a25eece835d32a5e813f6bbe1047fc6e8)`(DataType x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/arg-max/attrs#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ArgMax::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/arg-max/attrs) | Optional attribute setters for [ArgMax](/versions/r1.15/api_docs/cc/class/tensorflow/ops/arg-max#classtensorflow_1_1ops_1_1_arg_max). |\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### ArgMax\n\n```gdscript\n ArgMax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input dimension\n)\n``` \n\n### ArgMax\n\n```gdscript\n ArgMax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input dimension,\n const ArgMax::Attrs & attrs\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``` \n\nPublic static functions\n-----------------------\n\n### OutputType\n\n```text\nAttrs OutputType(\n DataType x\n)\n```"]]