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

Method evaluate

tensorflow/python/framework/test_util.py:2016–2033  ·  view source on GitHub ↗

Evaluates tensors and returns numpy values. Args: tensors: A Tensor or a nested list/tuple of Tensors. Returns: tensors numpy values.

(self, tensors)

Source from the content-addressed store, hash-verified

2014 return nest.map_structure(self._eval_tensor, tensors)
2015
2016 def evaluate(self, tensors):
2017 """Evaluates tensors and returns numpy values.
2018
2019 Args:
2020 tensors: A Tensor or a nested list/tuple of Tensors.
2021
2022 Returns:
2023 tensors numpy values.
2024 """
2025 if context.executing_eagerly():
2026 return self._eval_helper(tensors)
2027 else:
2028 sess = ops.get_default_session()
2029 if sess is None:
2030 with self.test_session() as sess:
2031 return sess.run(tensors)
2032 else:
2033 return sess.run(tensors)
2034
2035 # pylint: disable=g-doc-return-or-yield
2036 @contextlib.contextmanager

Callers 15

_GetNdArrayMethod · 0.95
_GetPyListMethod · 0.95
test_convert_denseMethod · 0.45
testJitMethod · 0.45
testCpuMultipleMethod · 0.45
testGpuNoneMethod · 0.45
testGpuMultipleMethod · 0.45
testVirtualGpuMethod · 0.45

Calls 4

_eval_helperMethod · 0.95
test_sessionMethod · 0.95
executing_eagerlyMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected