Applies the given device only if device is not None or empty.
(device)
| 75 | |
| 76 | @contextlib.contextmanager |
| 77 | def _MaybeDevice(device): |
| 78 | """Applies the given device only if device is not None or empty.""" |
| 79 | if device: |
| 80 | with ops.device(device): |
| 81 | yield |
| 82 | else: |
| 83 | yield |
| 84 | |
| 85 | |
| 86 | def _ProcessGraphDefParam(graph_def, op_dict): |
no test coverage detected