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:: Nghĩa là
#include <math_ops.h>
Tính giá trị trung bình của các phần tử theo kích thước của tensor.
Bản tóm tắt
Giảm input
dọc theo các kích thước được cho trong axis
. Trừ khi keep_dims
là đúng, thứ hạng của tensor sẽ giảm đi 1 cho mỗi mục trong axis
. Nếu keep_dims
là đúng thì kích thước giảm sẽ được giữ lại với độ dài 1.
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- đầu vào: Tenor cần giảm.
- trục: Các kích thước cần giảm. Phải nằm trong phạm vi
[-rank(input), rank(input))
.
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ề:
Bí danh:
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::Mean Class Reference\n\ntensorflow::ops::Mean\n=====================\n\n`#include \u003cmath_ops.h\u003e`\n\nComputes the mean of elements across dimensions of a tensor.\n\nSummary\n-------\n\nReduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: The tensor to reduce.\n- axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/mean/attrs#structtensorflow_1_1ops_1_1_mean_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/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The reduced tensor.\n\n\u003cbr /\u003e\n\nAliases:\n\n- ReduceMean\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Mean](#classtensorflow_1_1ops_1_1_mean_1a197238a837bef771356ceef555eb3fc5)`(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)` axis)` ||\n| [Mean](#classtensorflow_1_1ops_1_1_mean_1a4012ca456e79d366e748b30485e13896)`(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)` axis, const `[Mean::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/mean/attrs#structtensorflow_1_1ops_1_1_mean_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_mean_1a2d6d74ce2f11798a21c40e7802d15d30) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_mean_1a87264bbbee4da96f9ba784e0710505aa) | `::`[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_mean_1af104f07bacdeb2d4919e1b53d3e9c06d)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mean_1a6de63011b12a38e192d945bc750aa38a)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mean_1a7bcb6958d02f23b2e94caeaa619be29c)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| [KeepDims](#classtensorflow_1_1ops_1_1_mean_1a9c8b878945fc885afb0f6a74e28efac6)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/mean/attrs#structtensorflow_1_1ops_1_1_mean_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Mean::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/mean/attrs) | Optional attribute setters for [Mean](/versions/r1.15/api_docs/cc/class/tensorflow/ops/mean#classtensorflow_1_1ops_1_1_mean). |\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### Mean\n\n```gdscript\n Mean(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input axis\n)\n``` \n\n### Mean\n\n```gdscript\n Mean(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input axis,\n const Mean::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```"]]