(self, *args, **kwargs)
| 32 | |
| 33 | @wraps(func) |
| 34 | def wrapper(self, *args, **kwargs): |
| 35 | if len(args) == 0: |
| 36 | return |
| 37 | |
| 38 | if isinstance(args[0], list): |
| 39 | assert len(args) > 0 and isinstance(args[0][0], Tensor), ( |
| 40 | 'initialize function expects PlaceHolders or Tensors') |
| 41 | dev = args[0][0].device |
| 42 | else: |
| 43 | assert len(args) > 0 and isinstance(args[0], Tensor), ( |
| 44 | 'initialize function expects PlaceHolders or Tensors') |
| 45 | dev = args[0].device |
| 46 | |
| 47 | prev_state = dev.graph_enabled() |
| 48 | dev.EnableGraph(False) |
| 49 | func(self, *args, **kwargs) |
| 50 | self._initialized = True |
| 51 | dev.EnableGraph(prev_state) |
| 52 | |
| 53 | return wrapper |
| 54 |
nothing calls this directly
no test coverage detected