Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix bug in profiler tutorial when using cpu #13695

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/tutorials/python/profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ Let's define a method that will run one training iteration given data and label.

```python
# Use GPU if available
try:
mx.test_utils.list_gpus(); ctx = mx.gpu()
except:
ctx = mx.cpu()
if len(mx.test_utils.list_gpus())!=0:
ctx=mx.gpu()
else:
ctx=mx.cpu()

# Initialize the parameters with random weights
net.collect_params().initialize(mx.init.Xavier(), ctx=ctx)
Expand Down