MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IsTrainable

Function IsTrainable

tensorflow/python/ops/gradients_util.py:229–237  ·  view source on GitHub ↗
(tensor_or_dtype)

Source from the content-addressed store, hash-verified

227
228
229def IsTrainable(tensor_or_dtype):
230 if isinstance(tensor_or_dtype, ops.Tensor):
231 dtype = tensor_or_dtype.dtype
232 else:
233 dtype = tensor_or_dtype
234 dtype = dtypes.as_dtype(dtype)
235 return dtype.base_dtype in (dtypes.float16, dtypes.float32, dtypes.float64,
236 dtypes.complex64, dtypes.complex128,
237 dtypes.resource, dtypes.variant)
238
239
240def _IsBackpropagatable(tensor):

Callers 3

_IsBackpropagatableFunction · 0.85
_GradientsHelperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected