Convert numpy if not already numpy array.
(tensor)
| 53 | |
| 54 | |
| 55 | def 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 | |
| 63 | def gen_mention_pretraining_sample( |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…