จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: ป้องกันการไล่ระดับสี
#include <array_ops.h>
สหกรณ์ข้อมูลประจำตัวที่ทำให้เกิดข้อผิดพลาดหากมีการร้องขอการไล่ระดับสี
สรุป
เมื่อดำเนินการในกราฟ op นี้จะส่งออกเทนเซอร์อินพุตตามที่เป็นอยู่
เมื่อสร้าง Ops เพื่อคำนวณการไล่ระดับสี ระบบการไล่ระดับสี TensorFlow จะส่งกลับข้อผิดพลาดเมื่อพยายามค้นหาการไล่ระดับสีของ op นี้ เนื่องจากไม่จำเป็นต้องลงทะเบียนการไล่ระดับสีสำหรับฟังก์ชันนี้ การดำเนินการนี้มีไว้เพื่อป้องกันข้อบกพร่องเล็กๆ น้อยๆ จากการส่งคืนการไล่ระดับสีที่ไม่ได้ใช้งานอย่างเงียบๆ ในบางกรณี
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- อินพุต: เทนเซอร์ใดๆ
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- ข้อความ: จะถูกพิมพ์ออกมาเมื่อมีข้อผิดพลาดเมื่อมีใครพยายามแยกแยะการดำเนินการนี้
ผลตอบแทน:
-
Output
: เทนเซอร์อินพุตเดียวกัน
ฟังก์ชันคงที่สาธารณะ |
---|
Message (StringPiece x) | |
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
ข้อความ
Attrs Message(
StringPiece x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],null,["# tensorflow::ops::PreventGradient Class Reference\n\ntensorflow::ops::PreventGradient\n================================\n\n`#include \u003carray_ops.h\u003e`\n\nAn identity op that triggers an error if a gradient is requested.\n\nSummary\n-------\n\nWhen executed in a graph, this op outputs its input tensor as-is.\n\nWhen building ops to compute gradients, the TensorFlow gradient system will return an error when trying to lookup the gradient of this op, because no gradient must ever be registered for this function. This op exists to prevent subtle bugs from silently returning unimplemented gradients in some corner cases.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: any tensor.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/prevent-gradient/attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs)):\n\n- message: Will be printed in the error when anyone tries to differentiate this operation.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): the same input tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [PreventGradient](#classtensorflow_1_1ops_1_1_prevent_gradient_1a0b9966e0dc996fe02edcdfc60584d033)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input)` ||\n| [PreventGradient](#classtensorflow_1_1ops_1_1_prevent_gradient_1ae19edcd4e91e9dc4bc39684dfd8cfa74)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, const `[PreventGradient::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/prevent-gradient/attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_prevent_gradient_1a9b6a878872406f077395172368112563) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_prevent_gradient_1a4c8f001d1b1f87090e63ed718977d582) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_prevent_gradient_1a039d4498a7fd50b84e4246f6adab399e)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_prevent_gradient_1a20ebe0054ff4d6f2d7bb35242547bb7b)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_prevent_gradient_1a2e068c7e108d2325da28edbfd997cd02)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [Message](#classtensorflow_1_1ops_1_1_prevent_gradient_1a5e4b110d0c0f8f247fd80301b88df40d)`(StringPiece x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/prevent-gradient/attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::PreventGradient::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/prevent-gradient/attrs) | Optional attribute setters for [PreventGradient](/versions/r2.1/api_docs/cc/class/tensorflow/ops/prevent-gradient#classtensorflow_1_1ops_1_1_prevent_gradient). |\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### PreventGradient\n\n```gdscript\n PreventGradient(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input\n)\n``` \n\n### PreventGradient\n\n```gdscript\n PreventGradient(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n const PreventGradient::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### Message\n\n```text\nAttrs Message(\n StringPiece x\n)\n```"]]