tf.load_op_library
Stay organized with collections
Save and categorize content based on your preferences.
Loads a TensorFlow plugin, containing custom ops and kernels.
tf.load_op_library(
library_filename
)
Pass "library_filename" to a platform-specific mechanism for dynamically
loading a library. The rules for determining the exact location of the
library are platform-specific and are not documented here. When the
library is loaded, ops and kernels registered in the library via the
REGISTER_*
macros are made available in the TensorFlow process. Note
that ops with the same name as an existing op are rejected and not
registered with the process.
Args |
library_filename
|
Path to the plugin.
Relative or absolute filesystem path to a dynamic library file.
|
Returns |
A python module containing the Python wrappers for Ops defined in
the plugin.
|
Raises |
RuntimeError
|
when unable to load the library or get the python wrappers.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.load_op_library\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/framework/load_library.py#L31-L74) |\n\nLoads a TensorFlow plugin, containing custom ops and kernels.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.load_op_library`](https://www.tensorflow.org/api_docs/python/tf/load_op_library)\n\n\u003cbr /\u003e\n\n tf.load_op_library(\n library_filename\n )\n\nPass \"library_filename\" to a platform-specific mechanism for dynamically\nloading a library. The rules for determining the exact location of the\nlibrary are platform-specific and are not documented here. When the\nlibrary is loaded, ops and kernels registered in the library via the\n`REGISTER_*` macros are made available in the TensorFlow process. Note\nthat ops with the same name as an existing op are rejected and not\nregistered with the process.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------|-------------------------------------------------------------------------------------|\n| `library_filename` | Path to the plugin. Relative or absolute filesystem path to a dynamic library file. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A python module containing the Python wrappers for Ops defined in the plugin. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|----------------|-------------------------------------------------------------|\n| `RuntimeError` | when unable to load the library or get the python wrappers. |\n\n\u003cbr /\u003e"]]