MCPcopy Create free account
hub / github.com/google-research/language / tensor_to_numpy

Function tensor_to_numpy

language/mentionmemory/utils/test_utils.py:55–60  ·  view source on GitHub ↗

Convert numpy if not already numpy array.

(tensor)

Source from the content-addressed store, hash-verified

53
54
55def tensor_to_numpy(tensor):
56 """Convert numpy if not already numpy array."""
57 if isinstance(tensor, np.ndarray):
58 return tensor
59 else:
60 return tensor.numpy()
61
62
63def gen_mention_pretraining_sample(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…