Creates a fake module that looks like TensorFlow, for testing.
()
| 26 | |
| 27 | |
| 28 | def fake_tf(): |
| 29 | """Creates a fake module that looks like TensorFlow, for testing.""" |
| 30 | mod = imp.new_module('tensorflow') |
| 31 | mod_contents = {} |
| 32 | mod_contents.update(gen_math_ops.__dict__) |
| 33 | mod_contents.update(math_ops.__dict__) |
| 34 | mod_contents.update(ops.__dict__) |
| 35 | mod_contents.update(mod.__dict__) |
| 36 | mod.__dict__.update(mod_contents) |
| 37 | return mod |