()
| 114 | |
| 115 | |
| 116 | def monkeypatch_tf_layers(): |
| 117 | if get_tf_version_tuple() < (1, 4): |
| 118 | if not hasattr(tf.layers, 'Dense'): |
| 119 | from tensorflow.python.layers.core import Dense |
| 120 | tf.layers.Dense = Dense |
| 121 | |
| 122 | from tensorflow.python.layers.normalization import BatchNormalization |
| 123 | tf.layers.BatchNormalization = BatchNormalization |
| 124 | |
| 125 | from tensorflow.python.layers.convolutional import Conv2DTranspose, Conv2D |
| 126 | tf.layers.Conv2DTranspose = Conv2DTranspose |
| 127 | tf.layers.Conv2D = Conv2D |
| 128 | |
| 129 | from tensorflow.python.layers.pooling import MaxPooling2D, AveragePooling2D |
| 130 | tf.layers.MaxPooling2D = MaxPooling2D |
| 131 | tf.layers.AveragePooling2D = AveragePooling2D |
| 132 | |
| 133 | |
| 134 | monkeypatch_tf_layers() |
no test coverage detected