-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
tensorflow
: Add some functions from the config module.
#11325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
03dd434
Add some functions from the config module.
hoel-bagard 1d276d1
Add def __getattr__(name: str) -> Incomplete: ...
hoel-bagard 927b79f
fix set_visible_devices's input type.
hoel-bagard 45ad749
fix get_memory_usage's return type
hoel-bagard 9c1a8b6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] fd5f69d
Merge branch 'main' into hoel/add_tf_config
JelleZijlstra 9898dc7
fix: add deprecated decorator to get_memory_usage
hoel-bagard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from _typeshed import Incomplete | ||
from typing import NamedTuple | ||
|
||
from tensorflow.config import experimental as experimental | ||
|
||
class PhysicalDevice(NamedTuple): | ||
name: str | ||
device_type: str | ||
|
||
def list_physical_devices(device_type: None | str = None) -> list[PhysicalDevice]: ... | ||
def get_visible_devices(device_type: None | str = None) -> list[PhysicalDevice]: ... | ||
def set_visible_devices(devices: list[PhysicalDevice] | PhysicalDevice, device_type: None | str = None) -> None: ... | ||
def __getattr__(name: str) -> Incomplete: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import typing_extensions | ||
from _typeshed import Incomplete | ||
from typing import TypedDict | ||
|
||
from tensorflow.config import PhysicalDevice | ||
|
||
class _MemoryInfo(TypedDict): | ||
current: int | ||
peak: int | ||
|
||
def get_memory_info(device: str) -> _MemoryInfo: ... | ||
def reset_memory_stats(device: str) -> None: ... | ||
@typing_extensions.deprecated("This function is deprecated in favor of tf.config.experimental.get_memory_info") | ||
def get_memory_usage(device: PhysicalDevice) -> int: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this is deprecated:
Consider marking it with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 9898dc7 |
||
def get_memory_growth(device: PhysicalDevice) -> bool: ... | ||
def set_memory_growth(device: PhysicalDevice, enable: bool) -> None: ... | ||
def __getattr__(name: str) -> Incomplete: ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.