Browse Source

docs(mge/functional): update copy example

GitOrigin-RevId: 4011332ba6
release-1.11.1
Megvii Engine Team 2 years ago
parent
commit
e89ee63112
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      imperative/python/megengine/functional/tensor.py

+ 3
- 3
imperative/python/megengine/functional/tensor.py View File

@@ -1050,13 +1050,13 @@ def copy(inp, device=None):


Examples: Examples:


>>> x = megengine.tensor([1, 2, 3], numpy.int32)
>>> x = Tensor([1, 2, 3], numpy.int32)
Tensor([1 2 3], dtype=int32, device=xpux:0) Tensor([1 2 3], dtype=int32, device=xpux:0)


>>> megengine.functional.copy(x, 'cpu1')
>>> F.copy(x, 'cpu1')
Tensor([1 2 3], dtype=int32, device=cpu1:0) Tensor([1 2 3], dtype=int32, device=cpu1:0)


>>> megengine.functional.copy(x, 'xpu0')
>>> F.copy(x, 'xpu0')
Tensor([1 2 3], dtype=int32, device=xpu0:0) Tensor([1 2 3], dtype=int32, device=xpu0:0)


""" """


Loading…
Cancel
Save