Module: tf.compat
Stay organized with collections
Save and categorize content based on your preferences.
Functions for Python 2 vs. 3 compatibility.
Conversion routines
In addition to the functions below, as_str
converts an object to a str
.
Types
The compatibility module also provides the following types:
bytes_or_text_types
complex_types
integral_types
real_types
Modules
v1
module: Bring in all of the public TensorFlow interface into this module.
Functions
as_bytes(...)
: Converts bytearray
, bytes
, or unicode python input types to bytes
.
as_str(...)
: Converts any string-like python input types to unicode.
as_str_any(...)
: Converts input to str
type.
as_text(...)
: Converts any string-like python input types to unicode.
dimension_at_index(...)
: Compatibility utility required to allow for both V1 and V2 behavior in TF.
dimension_value(...)
: Compatibility utility required to allow for both V1 and V2 behavior in TF.
forward_compatibility_horizon(...)
: Context manager for testing forward compatibility of generated graphs.
forward_compatible(...)
: Return true if the forward compatibility window has expired.
path_to_str(...)
: Converts input which is a PathLike
object to str
type.
Other Members
bytes_or_text_types
complex_types
integral_types
real_types
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.
Last updated 2020-10-01 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 2020-10-01 UTC."],[],[],null,["# Module: tf.compat\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/compat) |\n\nFunctions for Python 2 vs. 3 compatibility.\n\nConversion routines\n-------------------\n\nIn addition to the functions below, `as_str` converts an object to a `str`.\n\nTypes\n-----\n\nThe compatibility module also provides the following types:\n\n- `bytes_or_text_types`\n- `complex_types`\n- `integral_types`\n- `real_types`\n\nModules\n-------\n\n[`v1`](../tf/compat/v1) module: Bring in all of the public TensorFlow interface into this module.\n\nFunctions\n---------\n\n[`as_bytes(...)`](../tf/compat/as_bytes): Converts `bytearray`, `bytes`, or unicode python input types to `bytes`.\n\n[`as_str(...)`](../tf/compat/as_text): Converts any string-like python input types to unicode.\n\n[`as_str_any(...)`](../tf/compat/as_str_any): Converts input to `str` type.\n\n[`as_text(...)`](../tf/compat/as_text): Converts any string-like python input types to unicode.\n\n[`dimension_at_index(...)`](../tf/compat/dimension_at_index): Compatibility utility required to allow for both V1 and V2 behavior in TF.\n\n[`dimension_value(...)`](../tf/compat/dimension_value): Compatibility utility required to allow for both V1 and V2 behavior in TF.\n\n[`forward_compatibility_horizon(...)`](../tf/compat/forward_compatibility_horizon): Context manager for testing forward compatibility of generated graphs.\n\n[`forward_compatible(...)`](../tf/compat/forward_compatible): Return true if the forward compatibility window has expired.\n\n[`path_to_str(...)`](../tf/compat/path_to_str): Converts input which is a `PathLike` object to `str` type.\n\nOther Members\n-------------\n\n- `bytes_or_text_types`\n- `complex_types`\n- `integral_types`\n- `real_types`"]]