TensorFlow与MindSpore¶
由社区提供的TensorFlow APIs和MindSpore APIs之间的映射,可能在参数、输入、输出、逻辑功能和特定场景等方面存在差异,可详见各API描述或已提供的差异对比。
也欢迎更多的MindSpore开发者参与完善映射内容。
tf¶
tf.data¶
MindSpore中的许多数据处理方法为各数据集类共有,下面以 GeneratorDataset
为例进行API差异对比,其他数据集类也是同理。
tf.distribute¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.distribute.Strategy | set_auto_parallel_context(parallel_mode=ParallelMode.DATA_PARALLEL) | 差异对比 |
tf.image¶
tf.io¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.io.decode_image | mindspore.dataset.vision.Decode | 差异对比 |
tf.keras¶
tf.layers¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.layers.Dense | mindspore.nn.Dense |
tf.linalg¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.linalg.inv | mindspore.ops.Inv | |
tf.linalg.matmul | mindspore.nn.MatMul |
tf.math¶
tf.metrics¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.metrics.mean_iou | mindspore.ops.IOU |
tf.nn¶
tf.random¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.random.gamma | mindspore.ops.Gamma | |
tf.random.uniform | mindspore.ops.uniform |
tf.sparse¶
TensorFlow 1.15 APIs | MindSpore APIs | 说明 |
---|---|---|
tf.sparse.SparseTensor | mindspore.SparseTensor |
tf.train¶
tfp¶
TensorFlow Probability 0.14.1 APIs | MindSpore APIs | 说明 |
---|---|---|
tfp.bijectors.Softplus | mindspore.nn.probability.bijector.Softplus | 差异对比 |