(self, ctx)
| 103 | pass |
| 104 | |
| 105 | def before_run(self, ctx): |
| 106 | fetches = self._before_run(ctx) |
| 107 | if fetches is None: |
| 108 | return None |
| 109 | if isinstance(fetches, tf.train.SessionRunArgs): |
| 110 | return fetches |
| 111 | |
| 112 | # also support list of names |
| 113 | assert isinstance(fetches, list), fetches |
| 114 | ret = [] |
| 115 | for f in fetches: |
| 116 | if isinstance(f, (tf.Tensor, tf.Operation)): |
| 117 | ret.append(f) |
| 118 | else: |
| 119 | # warn about speed |
| 120 | ret.append(get_op_or_tensor_by_name(f)) |
| 121 | return tf.train.SessionRunArgs(fetches=ret) |
| 122 | |
| 123 | def _before_run(self, ctx): |
| 124 | """ |
nothing calls this directly
no test coverage detected