Module: tfm.utils
Stay organized with collections
Save and categorize content based on your preferences.
Common TF utilities.
Modules
activations
module: Activations package definition.
Functions
assert_rank(...)
: Raises an exception if the tensor rank is not of the expected rank.
clone_initializer(...)
cross_replica_concat(...)
: Concatenates the given value
across (GPU/TPU) cores, along axis
.
deserialize_keras_object(...)
get_activation(...)
: Maps an identifier to a Python function, e.g., "relu" => tf.nn.relu
.
get_replica_id(...)
: Gets replica id depending on the environment.
get_shape_list(...)
: Returns a list of the shape of tensor, preferring static dimensions.
is_special_none_tensor(...)
: Checks if a tensor is a special None Tensor.
pack_inputs(...)
: Pack a list of inputs
tensors to a tuple. (deprecated)
safe_mean(...)
: Computes a safe mean of the losses.
serialize_activation(...)
serialize_constraint(...)
serialize_initializer(...)
serialize_keras_object(...)
serialize_layer(...)
serialize_regularizer(...)
unpack_inputs(...)
: unpack a tuple of inputs
tensors to a tuple. (deprecated)
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-02-02 UTC.
[null,null,["Last updated 2024-02-02 UTC."],[],[],null,["# Module: tfm.utils\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/models/blob/v2.15.0/official/modeling/tf_utils.py) |\n\nCommon TF utilities.\n\nModules\n-------\n\n[`activations`](../tfm/utils/activations) module: Activations package definition.\n\nFunctions\n---------\n\n[`assert_rank(...)`](../tfm/utils/assert_rank): Raises an exception if the tensor rank is not of the expected rank.\n\n[`clone_initializer(...)`](../tfm/utils/clone_initializer)\n\n[`cross_replica_concat(...)`](../tfm/utils/cross_replica_concat): Concatenates the given `value` across (GPU/TPU) cores, along `axis`.\n\n[`deserialize_keras_object(...)`](../tfm/utils/deserialize_keras_object)\n\n[`get_activation(...)`](../tfm/utils/get_activation): Maps an identifier to a Python function, e.g., \"relu\" =\\\u003e [`tf.nn.relu`](https://www.tensorflow.org/api_docs/python/tf/nn/relu).\n\n[`get_replica_id(...)`](../tfm/utils/get_replica_id): Gets replica id depending on the environment.\n\n[`get_shape_list(...)`](../tfm/utils/get_shape_list): Returns a list of the shape of tensor, preferring static dimensions.\n\n[`is_special_none_tensor(...)`](../tfm/utils/is_special_none_tensor): Checks if a tensor is a special None Tensor.\n\n[`pack_inputs(...)`](../tfm/utils/pack_inputs): Pack a list of `inputs` tensors to a tuple. (deprecated)\n\n[`safe_mean(...)`](../tfm/utils/safe_mean): Computes a safe mean of the losses.\n\n[`serialize_activation(...)`](../tfm/utils/serialize_activation)\n\n[`serialize_constraint(...)`](../tfm/utils/serialize_constraint)\n\n[`serialize_initializer(...)`](../tfm/utils/serialize_initializer)\n\n[`serialize_keras_object(...)`](../tfm/utils/serialize_keras_object)\n\n[`serialize_layer(...)`](../tfm/utils/serialize_layer)\n\n[`serialize_regularizer(...)`](../tfm/utils/serialize_regularizer)\n\n[`unpack_inputs(...)`](../tfm/utils/unpack_inputs): unpack a tuple of `inputs` tensors to a tuple. (deprecated)"]]