| 320 | // Template instantiations here |
| 321 | |
| 322 | inline bool IsDtypeTrainable(DataType dtype) { |
| 323 | switch (dtype) { |
| 324 | case DT_HALF: |
| 325 | case DT_BFLOAT16: |
| 326 | case DT_FLOAT: |
| 327 | case DT_DOUBLE: |
| 328 | case DT_COMPLEX64: |
| 329 | case DT_COMPLEX128: |
| 330 | case DT_RESOURCE: |
| 331 | case DT_VARIANT: |
| 332 | return true; |
| 333 | default: |
| 334 | return false; |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | template <typename Gradient, typename BackwardFunction, typename TapeTensor> |
| 339 | bool GradientTape<Gradient, BackwardFunction, TapeTensor>::ShouldRecord( |
no outgoing calls
no test coverage detected