| 167 | self._debug_info = None |
| 168 | |
| 169 | def _grappler_config(self): |
| 170 | is_only_flex_enabled = ( |
| 171 | set([OpsSet.SELECT_TF_OPS]) == set(self.target_spec.supported_ops)) |
| 172 | optimizers = ["constfold"] |
| 173 | if is_only_flex_enabled: |
| 174 | # The layout optimizer turns NHCW to NCHW. This provides performance |
| 175 | # optimizations when Flex mode is enabled. However, this is not compatible |
| 176 | # with builtin ops. |
| 177 | optimizers.append("layout") |
| 178 | return _get_grappler_config(optimizers) |
| 179 | |
| 180 | def _validate_representative_dataset(self): |
| 181 | if self.representative_dataset: |