ExecutionEnvironment
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.
Các lớp con gián tiếp đã biết Phiên háo hức | Một môi trường để thực hiện các hoạt động TensorFlow một cách háo hức. | đồ thị | Biểu đồ luồng dữ liệu biểu thị tính toán TensorFlow. |
|
Xác định môi trường để tạo và thực thi Operation
TensorFlow.
Phương pháp công khai
khoảng trống trừu tượng | checkInput (Đầu vào Op ) Kiểm tra xem input có hợp lệ để sử dụng làm đầu vào trong môi trường thực thi này hay không. |
trừu tượng ExecutionEnvironment.Types | loại môi trường () Lấy loại môi trường này (từ bảng liệt kê `Environments`. |
trừu tượng boolean | |
trừu tượng boolean | |
trừu tượng boolean | isOpEnabled (Loại chuỗi op) Trả về true nếu thao tác đã cho hợp lệ trong môi trường thực thi này. |
trừu tượng OperationBuilder | |
Phương pháp công khai
Kiểm tra xem input
có hợp lệ để sử dụng làm đầu vào trong môi trường thực thi này hay không. Ném IllegalArgumentException
nếu không.
Thông số
đầu vào | Lựa chọn để kiểm tra |
---|
Ném
Ngoại lệ Đối số bất hợp pháp | nếu đầu vào không thể được sử dụng làm đầu vào trong môi trường thực thi này. |
---|
Lấy loại môi trường này (từ bảng liệt kê `Environments`.
Trả lại
- Giá trị `Môi trường` cho biết loại môi trường thực thi.
boolean trừu tượng công khai isEager ()
boolean trừu tượng công khai isGraph ()
boolean trừu tượng công khai isOpEnabled (String opType)
Trả về true nếu thao tác đã cho hợp lệ trong môi trường thực thi này.
Thông số
loại tùy chọn | Các op để kiểm tra. |
---|
Trả lại
- Liệu thao tác đã cho có hợp lệ trong môi trường thực thi này hay không.
tóm tắt công khai OperationBuilder opBuilder (Loại chuỗi, Tên chuỗi)
Trả về một trình xây dựng để tạo một Operation
mới.
Thông số
kiểu | của Hoạt động (nghĩa là xác định tính toán sẽ được thực hiện) |
---|
tên | để chỉ Hoạt động được tạo trong phạm vi môi trường này. |
---|
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-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# ExecutionEnvironment\n\npublic interface **ExecutionEnvironment** \n\n|---|---|---|\n| Known Indirect Subclasses [EagerSession](/jvm/api_docs/java/org/tensorflow/EagerSession), [Graph](/jvm/api_docs/java/org/tensorflow/Graph) |----------------------------------------------------------------|-------------------------------------------------------------| | [EagerSession](/jvm/api_docs/java/org/tensorflow/EagerSession) | An environment for executing TensorFlow operations eagerly. | | [Graph](/jvm/api_docs/java/org/tensorflow/Graph) | A data flow graph representing a TensorFlow computation. | |||\n\nDefines an environment for creating and executing TensorFlow [Operation](/jvm/api_docs/java/org/tensorflow/Operation)s. \n\n### Nested Classes\n\n|------|---|---|---|\n| enum | [ExecutionEnvironment.Types](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment.Types) || |\n\n### Public Methods\n\n|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [checkInput](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment#checkInput(org.tensorflow.op.Op))([Op](/jvm/api_docs/java/org/tensorflow/op/Op) input) Checks that `input` is valid to use as an input in this execution environment. |\n| abstract [ExecutionEnvironment.Types](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment.Types) | [environmentType](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment#environmentType())() Get the type of this environment (from the \\`Environments\\` enumeration. |\n| abstract boolean | [isEager](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment#isEager())() |\n| abstract boolean | [isGraph](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment#isGraph())() |\n| abstract boolean | [isOpEnabled](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment#isOpEnabled(java.lang.String))(String opType) Returns true if the given operation is valid in this execution environment. |\n| abstract [OperationBuilder](/jvm/api_docs/java/org/tensorflow/OperationBuilder) | [opBuilder](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment#opBuilder(java.lang.String, java.lang.String))(String type, String name) Returns a builder to create a new [Operation](/jvm/api_docs/java/org/tensorflow/Operation). |\n\nPublic Methods\n--------------\n\n#### public abstract void\n**checkInput**\n([Op](/jvm/api_docs/java/org/tensorflow/op/Op) input)\n\nChecks that `input` is valid to use as an input in this execution environment. Throws [IllegalArgumentException](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html) if not. \n\n##### Parameters\n\n| input | The op to check |\n|-------|-----------------|\n\n##### Throws\n\n| IllegalArgumentException | if input can't be used as an input in this execution environment. |\n|--------------------------|-------------------------------------------------------------------|\n\n#### public abstract [ExecutionEnvironment.Types](/jvm/api_docs/java/org/tensorflow/ExecutionEnvironment.Types)\n**environmentType**\n()\n\nGet the type of this environment (from the \\`Environments\\` enumeration. \n\n##### Returns\n\n- An \\`Environments\\` value indicating the type of execution environment. \n\n#### public abstract boolean\n**isEager**\n()\n\n\u003cbr /\u003e\n\n#### public abstract boolean\n**isGraph**\n()\n\n\u003cbr /\u003e\n\n#### public abstract boolean\n**isOpEnabled**\n(String opType)\n\nReturns true if the given operation is valid in this execution environment. \n\n##### Parameters\n\n| opType | The op to check. |\n|--------|------------------|\n\n##### Returns\n\n- Whether the given operation is valid in this execution environment. \n\n#### public abstract [OperationBuilder](/jvm/api_docs/java/org/tensorflow/OperationBuilder)\n**opBuilder**\n(String type, String name)\n\nReturns a builder to create a new [Operation](/jvm/api_docs/java/org/tensorflow/Operation). \n\n##### Parameters\n\n| type | of the Operation (i.e., identifies the computation to be performed) |\n| name | to refer to the created Operation in this environment scope. |\n|------|---------------------------------------------------------------------|\n\n##### Returns\n\n- an [OperationBuilder](/jvm/api_docs/java/org/tensorflow/OperationBuilder) to create an Operation when [build()](/jvm/api_docs/java/org/tensorflow/OperationBuilder#build()) is invoked. If [build()](/jvm/api_docs/java/org/tensorflow/OperationBuilder#build()) is not invoked, then some resources may leak."]]