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:: Xô
#include <math_ops.h>
Phân loại 'đầu vào' dựa trên 'ranh giới'.
Bản tóm tắt
Ví dụ: nếu đầu vào là ranh giới = [0, 10, 100] input = [[-5, 10000] [150, 10] [5, 100]]
thì đầu ra sẽ là out = [[0, 3] [3, 2] [1, 3]]
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- đầu vào: Bất kỳ hình dạng nào của Tensor đều chứa kiểu int hoặc float.
- ranh giới: Một danh sách các float được sắp xếp sẽ đưa ra ranh giới của các nhóm.
Trả về:
-
Output
: Hình dạng tương tự với 'đầu vào', mỗi giá trị của đầu vào được thay thế bằng chỉ mục nhóm.
(numpy) Tương đương với np.digitize.
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
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::Bucketize Class Reference\n\ntensorflow::ops::Bucketize\n==========================\n\n`#include \u003cmath_ops.h\u003e`\n\nBucketizes 'input' based on 'boundaries'.\n\nSummary\n-------\n\nFor example, if the inputs are boundaries = \\[0, 10, 100\\] input = \\[\\[-5, 10000\\] \\[150, 10\\] \\[5, 100\\]\\]\n\nthen the output will be output = \\[\\[0, 3\\] \\[3, 2\\] \\[1, 3\\]\\]\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: [Any](/versions/r2.3/api_docs/cc/class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any) shape of [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) contains with int or float type.\n- boundaries: A sorted list of floats gives the boundary of the buckets.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Same shape with 'input', each value of input replaced with bucket index.\n\n\u003cbr /\u003e\n\n(numpy) Equivalent to np.digitize.\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Bucketize](#classtensorflow_1_1ops_1_1_bucketize_1a104987760896f84594d21a17738a6fe1)`(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)` input, const gtl::ArraySlice\u003c float \u003e & boundaries)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_bucketize_1a11d9d7e39578db3e3dfaf2ef9213ae34) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_bucketize_1aa111bb19d459f3f26ae8f03297739125) | `::`[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_bucketize_1af82e929e268a0301d7ce4c41480a19e4)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_bucketize_1a7d66691237f8de46ab0c52782419cf53)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_bucketize_1aa3f697a162b180d9aa7847cb7d22dc3e)`() 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### Bucketize\n\n```gdscript\n Bucketize(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n const gtl::ArraySlice\u003c float \u003e & boundaries\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```"]]