tf.utils module
tf.utils module¶
- tf.utils.boundary_cast(x, name=None)¶
Internal measure to ensure matching between Tensorflow and the CS-1.
Closest operation to match the mixed precision on the CS-1.
- Parameters
x – The tensor to boundary cast.
- Returns
The tensor
xcast down tofloat16and back tofloat32.- Return type
x
- tf.utils.summarize_tensor(x, is_gradient_tensor=False, op_name_if_grad=None)¶
Attach a summary to the specified tensor.
This function is added separately from the
summary_layerbelow, because some tensors might be generated using thetf.custom_gradients, which would disallow finding the gradient tensor usingsummary_layer. In such case, the user writing a custom gradient must manually specify the gradient tensor to summarize.- Parameters
x (tf.Tensor) – Tensor to summarize.
is_gradient_tensor (bool) – Boolean that decides whether to designate the tensor’s name as within the gradients.
op_name_if_grad (str) – If
is_gradient_tensor==True, then use this name, prefixed by"gradients/", as the summary name.
- tf.utils.summary_layer(x)¶
Attaches a summary to a tensor and its delta.
- Parameters
x (tf.Tensor) – Tensor to summarize.