diff --git a/tutorials/source_en/quick_start/quick_start.md b/tutorials/source_en/quick_start/quick_start.md index c14baceec3229dbd99a86e518a8e38b85ae83964..0ad4925190e0871799c9addc858df112243c53b0 100644 --- a/tutorials/source_en/quick_start/quick_start.md +++ b/tutorials/source_en/quick_start/quick_start.md @@ -99,8 +99,7 @@ if __name__ == "__main__": parser.add_argument('--device_target', type=str, default="CPU", choices=['Ascend', 'GPU', 'CPU'], help='device where the code will be implemented (default: CPU)') args = parser.parse_args() - context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target, - enable_mem_reuse=False) + context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target) ... ``` diff --git a/tutorials/source_zh_cn/advanced_use/distributed_training.md b/tutorials/source_zh_cn/advanced_use/distributed_training.md index 45fd0488d9cdc763e4d8217a6d295f9cfe9ac3a0..50a5d660a302f54dde7492726b736d5dfd4262be 100644 --- a/tutorials/source_zh_cn/advanced_use/distributed_training.md +++ b/tutorials/source_zh_cn/advanced_use/distributed_training.md @@ -250,7 +250,6 @@ from resnet import resnet50 device_id = int(os.getenv('DEVICE_ID')) context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") context.set_context(device_id=device_id) # set device_id -context.set_context(enable_loop_sink=True) def test_train_cifar(num_classes=10, epoch_size=10): context.set_auto_parallel_context(parallel_mode=ParallelMode.AUTO_PARALLEL, mirror_mean=True) @@ -263,7 +262,7 @@ def test_train_cifar(num_classes=10, epoch_size=10): model.train(epoch_size, dataset, callbacks=[loss_cb], dataset_sink_mode=True) ``` 其中, -- `dataset_sink_mode=True`,`enable_loop_sink=True`:表示采用数据集的下沉模式,即训练的计算下沉到硬件平台中执行。 +- `dataset_sink_mode=True`:表示采用数据集的下沉模式,即训练的计算下沉到硬件平台中执行。 - `LossMonitor`:能够通过回调函数返回Loss值,用于监控损失函数。 ## 运行脚本 diff --git a/tutorials/source_zh_cn/quick_start/quick_start.md b/tutorials/source_zh_cn/quick_start/quick_start.md index 605238850a856f7ddb8b052e48369e87ce0717ef..f4ffebd70e9d5c714bea5fe571313d09e362a36b 100644 --- a/tutorials/source_zh_cn/quick_start/quick_start.md +++ b/tutorials/source_zh_cn/quick_start/quick_start.md @@ -101,8 +101,7 @@ if __name__ == "__main__": parser.add_argument('--device_target', type=str, default="CPU", choices=['Ascend', 'GPU', 'CPU'], help='device where the code will be implemented (default: CPU)') args = parser.parse_args() - context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target, - enable_mem_reuse=False) + context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target) ... ``` diff --git a/tutorials/tutorial_code/distributed_training/resnet50_distributed_training.py b/tutorials/tutorial_code/distributed_training/resnet50_distributed_training.py index 6937cb1e9b72271ec18de159d22a3130b124be29..8064fb87365c8ed9984eb48c23e02a82009b51a4 100644 --- a/tutorials/tutorial_code/distributed_training/resnet50_distributed_training.py +++ b/tutorials/tutorial_code/distributed_training/resnet50_distributed_training.py @@ -36,8 +36,6 @@ from resnet import resnet50 device_id = int(os.getenv('DEVICE_ID')) context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") context.set_context(device_id=device_id) # set device_id -context.set_context(enable_loop_sink=True) -context.set_context(enable_mem_reuse=False) init() rank_id = get_rank() diff --git a/tutorials/tutorial_code/lenet.py b/tutorials/tutorial_code/lenet.py index 797c63b9da9609ae5616c519e64af73692b8fdd6..84d0a9c54afd3d6cb4f5904b70709644b4a8753a 100644 --- a/tutorials/tutorial_code/lenet.py +++ b/tutorials/tutorial_code/lenet.py @@ -195,8 +195,7 @@ if __name__ == "__main__": parser.add_argument('--device_target', type=str, default="CPU", choices=['Ascend', 'GPU', 'CPU'], help='device where the code will be implemented (default: CPU)') args = parser.parse_args() - context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target, - enable_mem_reuse=False) + context.set_context(mode=context.GRAPH_MODE, device_target=args.device_target) # download mnist dataset download_dataset() # learning rate setting diff --git a/tutorials/tutorial_code/resnet/cifar_resnet50.py b/tutorials/tutorial_code/resnet/cifar_resnet50.py index 40e66165ce640239113f2285fdaa49a08855de50..c77059041ca0402cfdf75b631723bb7307969c87 100644 --- a/tutorials/tutorial_code/resnet/cifar_resnet50.py +++ b/tutorials/tutorial_code/resnet/cifar_resnet50.py @@ -55,8 +55,6 @@ data_home = args_opt.dataset_path context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") context.set_context(device_id=device_id) -context.set_context(enable_loop_sink=False) -context.set_context(enable_mem_reuse=False) def create_dataset(repeat_num=1, training=True): """ diff --git a/tutorials/tutorial_code/sample_for_cloud/resnet50_train.py b/tutorials/tutorial_code/sample_for_cloud/resnet50_train.py index af5ee4fa09eae8255b319936e181f9d9d875436d..6d7030bfd72d4ff689020ef3744fe246d4b778a2 100644 --- a/tutorials/tutorial_code/sample_for_cloud/resnet50_train.py +++ b/tutorials/tutorial_code/sample_for_cloud/resnet50_train.py @@ -117,8 +117,6 @@ def resnet50_train(args_opt): # set graph mode and parallel mode context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", save_graphs=False) context.set_context(device_id=device_id) - context.set_context(enable_loop_sink=True) - context.set_context(enable_mem_reuse=True) if device_num > 1: context.set_auto_parallel_context(device_num=device_num, parallel_mode=ParallelMode.DATA_PARALLEL,