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:: ClipByValue
#include <math_ops.h>
Cắt các giá trị tensor về mức tối thiểu và tối đa được chỉ định.
Bản tóm tắt
Cho một tensor t
, thao tác này trả về một tensor cùng loại và hình dạng như t
với các giá trị của nó được cắt thành clip_value_min
và clip_value_max
. Mọi giá trị nhỏ hơn clip_value_min
được đặt thành clip_value_min
. Mọi giá trị lớn hơn clip_value_max
đều được đặt thành clip_value_max
.
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- t: Một
Tensor
. - clip_value_min:
Tensor
0-D (vô hướng) hoặc Tensor
có hình dạng giống như t
. Giá trị tối thiểu để cắt theo. - clip_value_max:
Tensor
0-D (vô hướng) hoặc Tensor
có hình dạng giống như t
. Giá trị tối đa để cắt theo.
Trả về:
-
Output
: Một Tensor
được cắt bớt có hình dạng giống như đầu vào 't'.
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::ClipByValue Class Reference\n\ntensorflow::ops::ClipByValue\n============================\n\n`#include \u003cmath_ops.h\u003e`\n\nClips tensor values to a specified min and max.\n\nSummary\n-------\n\nGiven a tensor `t`, this operation returns a tensor of the same type and shape as `t` with its values clipped to `clip_value_min` and `clip_value_max`. [Any](/versions/r2.0/api_docs/cc/class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any) values less than `clip_value_min` are set to `clip_value_min`. [Any](/versions/r2.0/api_docs/cc/class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any) values greater than `clip_value_max` are set to `clip_value_max`.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- t: A [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- clip_value_min: A 0-D (scalar) [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), or a [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with the same shape as `t`. The minimum value to clip by.\n- clip_value_max: A 0-D (scalar) [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), or a [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with the same shape as `t`. The maximum value to clip by.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A clipped [Tensor](/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with the same shape as input 't'.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ClipByValue](#classtensorflow_1_1ops_1_1_clip_by_value_1ab526bd89e515b8086815ed1ca60ee26b)`(const ::`[tensorflow::Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` t, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` clip_value_min, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` clip_value_max)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_clip_by_value_1a6ea3cb903878a47217c33415704ba5d0) | [Operation](/versions/r2.0/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_clip_by_value_1aaeb2e1fae647e0a8606ada4557524321) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_clip_by_value_1a53b0735ad42735c966c3a18bd0425150)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_clip_by_value_1afb378365ea16f406988ca25a97ef57b9)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_clip_by_value_1a7cb582679c053b906ea8f0e1df01a18a)`() 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### ClipByValue\n\n```gdscript\n ClipByValue(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input t,\n ::tensorflow::Input clip_value_min,\n ::tensorflow::Input clip_value_max\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```"]]