Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: thưa thớtReduceMax
#include <sparse_ops.h>
Tính toán tối đa các phần tử trên các kích thước của SparseTensor.
Bản tóm tắt
Op này có SparseTensor và là đối tác thưa thớt của tf.reduce_max()
. Đặc biệt, Op này còn trả về một Tensor
dày đặc thay vì thưa thớt.
Giảm sp_input
dọc theo các kích thước được đưa ra trong reduction_axes
. Trừ khi keep_dims
là đúng, thứ hạng của tensor sẽ giảm đi 1 cho mỗi mục nhập trong reduction_axes
. Nếu keep_dims
là đúng thì kích thước giảm sẽ được giữ lại với độ dài 1.
Nếu reduction_axes
không có mục nào, tất cả các kích thước sẽ giảm và trả về một tenxơ có một phần tử. Ngoài ra, các trục có thể âm, được diễn giải theo quy tắc lập chỉ mục trong Python.
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- đầu vào_chỉ số: 2-D. Ma trận
N x R
với các chỉ số của các giá trị không trống trong SparseTensor, có thể không theo thứ tự chuẩn. - giá trị đầu vào: 1-D.
N
giá trị không trống tương ứng với input_indices
. - đầu vào_hình dạng: 1-D. Hình dạng của SparseTensor đầu vào.
- trục_giảm: 1-D. Chiều dài-
K
vector chứa các trục rút gọn.
Thuộc tính tùy chọn (xem Attrs
):
- keep_dims: Nếu đúng, giữ lại kích thước đã giảm với độ dài 1.
Trả về:
Các hàm tĩnh công khai |
---|
KeepDims (bool x) | |
Thuộc tính công khai
Chức năng công cộng
nút
::tensorflow::Node * node() const
operator::tensorflow::Input() const
toán tử::tenorflow::Đầu ra
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Giữ Dims
Attrs KeepDims(
bool x
)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# tensorflow::ops::SparseReduceMax Class Reference\n\ntensorflow::ops::SparseReduceMax\n================================\n\n`#include \u003csparse_ops.h\u003e`\n\nComputes the max of elements across dimensions of a SparseTensor.\n\nSummary\n-------\n\nThis Op takes a SparseTensor and is the sparse counterpart to `tf.reduce_max()`. In particular, this Op also returns a dense [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) instead of a sparse one.\n\nReduces `sp_input` along the dimensions given in `reduction_axes`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained with length 1.\n\nIf `reduction_axes` has no entries, all dimensions are reduced, and a tensor with a single element is returned. Additionally, the axes can be negative, which are interpreted according to the indexing rules in Python.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.\n- input_values: 1-D. `N` non-empty values corresponding to `input_indices`.\n- input_shape: 1-D. Shape of the input SparseTensor.\n- reduction_axes: 1-D. Length-`K` vector containing the reduction axes.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs)):\n\n- keep_dims: If true, retain reduced dimensions with length 1.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): `R-K`-D. The reduced [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseReduceMax](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1aeae496cfc74e42b24882c7d5148b23e0)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_indices, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_values, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_shape, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` reduction_axes)` ||\n| [SparseReduceMax](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a451a0e2215cd3d4e69813f5405ae454f)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_indices, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_values, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_shape, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` reduction_axes, const `[SparseReduceMax::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a90126f27d38e5eddd6614a6f5330b139) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1ada3c0765be81f44a13f068c10a43cb34) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a886a875c7b1cfc9b2f69ce45239582c3)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a99bf4a11aed55ac04ed9aadfe5f3c8f9)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1a6687bcf1dca9bdb8019f8fcf46c00a17)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| [KeepDims](#classtensorflow_1_1ops_1_1_sparse_reduce_max_1adc6b4f1a804b4ca85bc40b2a677288ae)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::SparseReduceMax::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-reduce-max/attrs) | Optional attribute setters for [SparseReduceMax](/versions/r2.2/api_docs/cc/class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_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### SparseReduceMax\n\n```gdscript\n SparseReduceMax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input_indices,\n ::tensorflow::Input input_values,\n ::tensorflow::Input input_shape,\n ::tensorflow::Input reduction_axes\n)\n``` \n\n### SparseReduceMax\n\n```gdscript\n SparseReduceMax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input_indices,\n ::tensorflow::Input input_values,\n ::tensorflow::Input input_shape,\n ::tensorflow::Input reduction_axes,\n const SparseReduceMax::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### KeepDims\n\n```text\nAttrs KeepDims(\n bool x\n)\n```"]]