Recursively applies some optimizations to this layer: * Alias variables with the same shape and value. * Quantize weights. Arguments: quantization: Weight quantization scheme (possible values are: int8, int8_float32, int8_float16, int8_bfloat16, int16,
(self, quantization: Optional[str] = None)
| 260 | self._visit(_quantize) |
| 261 | |
| 262 | def optimize(self, quantization: Optional[str] = None) -> None: |
| 263 | """Recursively applies some optimizations to this layer: |
| 264 | |
| 265 | * Alias variables with the same shape and value. |
| 266 | * Quantize weights. |
| 267 | |
| 268 | Arguments: |
| 269 | quantization: Weight quantization scheme (possible values are: int8, int8_float32, |
| 270 | int8_float16, int8_bfloat16, int16, float16, bfloat16, float32). |
| 271 | """ |
| 272 | self._alias_variables() |
| 273 | self._quantize(quantization) |
| 274 | |
| 275 | def _visit(self, fn): |
| 276 | """Recursively visits this layer and its children.""" |