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:: chuỗi
#include <string_ops.h>
Chuyển đổi từng mục trong tensor đã cho thành chuỗi.
Bản tóm tắt
Hỗ trợ nhiều loại số và boolean.
Đối với Unicode, hãy xem hướng dẫn [ https://www.tensorflow.org/tutorials/repositionation/unicode ](Làm việc với văn bản Unicode).
Lập luận:
Thuộc tính tùy chọn (xem Attrs
):
- độ chính xác: Độ chính xác sau thập phân được sử dụng cho các số dấu phẩy động. Chỉ được sử dụng nếu độ chính xác > -1.
- khoa học: Sử dụng ký hiệu khoa học cho số dấu phẩy động.
- ngắn nhất: Sử dụng cách biểu diễn ngắn nhất (theo khoa học hoặc tiêu chuẩn) cho số dấu phẩy động.
- chiều rộng: Đệm các số trước thập phân theo chiều rộng này. Áp dụng cho cả số dấu phẩy động và số nguyên. Chỉ được sử dụng nếu chiều rộng > -1.
- điền: Giá trị cần đệm nếu chiều rộng > -1. Nếu trống, hãy đệm bằng dấu cách. Một giá trị điển hình khác là '0'. Chuỗi không thể dài hơn 1 ký tự.
Trả về:
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
Đổ đầy
Attrs Fill(
StringPiece x
)
Độ chính xác
Attrs Precision(
int64 x
)
Có tính khoa học
Attrs Scientific(
bool x
)
Ngắn nhất
Attrs Shortest(
bool x
)
Chiều rộng
Attrs Width(
int64 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::AsString Class Reference\n\ntensorflow::ops::AsString\n=========================\n\n`#include \u003cstring_ops.h\u003e`\n\nConverts each entry in the given tensor to strings.\n\nSummary\n-------\n\nSupports many numeric types and boolean.\n\nFor Unicode, see the \\[\u003chttps://www.tensorflow.org/tutorials/representation/unicode\u003e\\](Working with Unicode text) tutorial.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)):\n\n- precision: The post-decimal precision to use for floating point numbers. Only used if precision \\\u003e -1.\n- scientific: Use scientific notation for floating point numbers.\n- shortest: Use shortest representation (either scientific or standard) for floating point numbers.\n- width: [Pad](/versions/r1.15/api_docs/cc/class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad) pre-decimal numbers to this width. Applies to both floating point and integer numbers. Only used if width \\\u003e -1.\n- fill: The value to pad if width \\\u003e -1. If empty, pads with spaces. Another typical value is '0'. String cannot be longer than 1 character.\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| [AsString](#classtensorflow_1_1ops_1_1_as_string_1a93703cfbec4867fde47aa2259770786d)`(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)` ||\n| [AsString](#classtensorflow_1_1ops_1_1_as_string_1a48e83706cffb25050240d9ae8e2d84e4)`(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, const `[AsString::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_as_string_1a4f40ee7fcae884138385d66946669132) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_as_string_1afd5f84ceab758a320b25af91eb1614ff) | `::`[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_as_string_1abb163457f3457bfe14dd5192aeced5c5)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_as_string_1a25d4641309fe3d0f801105ad0b3027be)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_as_string_1a0b6fa38b640976c2d6651a9a96ae9fec)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| [Fill](#classtensorflow_1_1ops_1_1_as_string_1ac3d8aab67abdc6322377e5d914aa3124)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs) |\n| [Precision](#classtensorflow_1_1ops_1_1_as_string_1aa3a1688f03e1afc119452b92d96054ff)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs) |\n| [Scientific](#classtensorflow_1_1ops_1_1_as_string_1a258997efffeb32c7733aaeef5f6b3614)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs) |\n| [Shortest](#classtensorflow_1_1ops_1_1_as_string_1acfa9078d608f2939a48684fbf6607558)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs) |\n| [Width](#classtensorflow_1_1ops_1_1_as_string_1a5c6d3289fae480ee2909b51f14351bf5)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs) |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::AsString::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/as-string/attrs) | Optional attribute setters for [AsString](/versions/r1.15/api_docs/cc/class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string). |\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### AsString\n\n```gdscript\n AsString(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input\n)\n``` \n\n### AsString\n\n```gdscript\n AsString(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n const AsString::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### Fill\n\n```text\nAttrs Fill(\n StringPiece x\n)\n``` \n\n### Precision\n\n```text\nAttrs Precision(\n int64 x\n)\n``` \n\n### Scientific\n\n```text\nAttrs Scientific(\n bool x\n)\n``` \n\n### Shortest\n\n```text\nAttrs Shortest(\n bool x\n)\n``` \n\n### Width\n\n```text\nAttrs Width(\n int64 x\n)\n```"]]