---
title: 迁移思路
description: TF Adapter适配TensorFlow 1.15的思路是：
url: "https://www.hiascend.com/document/detail/zh/TensorFlowCommercial/900/migration/tfmigr1/tfmigr1_000151.html"
---

# 迁移思路

TF Adapter适配TensorFlow 1.15的思路是：

利用TensorFlow提供的config扩展机制，将NPU上的相关功能配置通过config的方式向下传递；然后再利用TensorFlow提供的优化器注册机制注册NPU上的优化器并根据config配置对图进行处理；最终将处理好的图下发到CANN平台执行。

所以手工迁移的主要点是添加NPU上的config配置，将扩展后的NPU config传入tf.Session的config参数。TensorFlow 1.15中常见的Estimator、sess.run、Keras三种脚本最终都是调用sess.run实现的，所以三种脚本的迁移方式本质上是一致的。
