forked from mindspore-Ecosystem/mindspore
!18548 fix docs of GradOperations for its example appears wrong output and add the CPU platform to docs of some operators
Merge pull request !18548 from dinglinhe/code_docs_dlh_ms_I3W537
This commit is contained in:
commit
e263ae8874
|
@ -88,7 +88,7 @@ class WithLossCell(Cell):
|
||||||
TypeError: If dtype of `data` or `label` is neither float16 nor float32.
|
TypeError: If dtype of `data` or `label` is neither float16 nor float32.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = Net()
|
>>> net = Net()
|
||||||
|
@ -150,7 +150,7 @@ class WithGradCell(Cell):
|
||||||
TypeError: If `sens` is not one of None, Tensor, Scalar or Tuple.
|
TypeError: If `sens` is not one of None, Tensor, Scalar or Tuple.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> # For a defined network Net without loss function
|
>>> # For a defined network Net without loss function
|
||||||
|
@ -304,7 +304,7 @@ class TrainOneStepCell(Cell):
|
||||||
TypeError: If `sens` is not a number.
|
TypeError: If `sens` is not a number.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = Net()
|
>>> net = Net()
|
||||||
|
@ -605,7 +605,7 @@ class WithEvalCell(Cell):
|
||||||
TypeError: If `add_cast_fp32` is not a bool.
|
TypeError: If `add_cast_fp32` is not a bool.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> # For a defined network Net without loss function
|
>>> # For a defined network Net without loss function
|
||||||
|
@ -642,7 +642,7 @@ class ParameterUpdate(Cell):
|
||||||
KeyError: If parameter with the specified name does not exist.
|
KeyError: If parameter with the specified name does not exist.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend``
|
``Ascend`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> network = nn.Dense(3, 4)
|
>>> network = nn.Dense(3, 4)
|
||||||
|
|
|
@ -77,7 +77,7 @@ def core(fn=None, **flags):
|
||||||
other flag. Default: None.
|
other flag. Default: None.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = Net()
|
>>> net = Net()
|
||||||
|
@ -271,9 +271,9 @@ class GradOperation(GradOperation_):
|
||||||
>>> print(output)
|
>>> print(output)
|
||||||
(Tensor(shape=[2, 3], dtype=Float32, value=
|
(Tensor(shape=[2, 3], dtype=Float32, value=
|
||||||
[[ 2.21099997e+00, 5.09999990e-01, 1.49000001e+00],
|
[[ 2.21099997e+00, 5.09999990e-01, 1.49000001e+00],
|
||||||
[ 5.58799982e+00, 2.68000007e+00, 4.07000017e+00]]), Tensor(shape=[3, 3], dtype=Float32, value=
|
[ 5.58800030e+00, 2.68000007e+00, 4.07000017e+00]]), Tensor(shape=[3, 3], dtype=Float32, value=
|
||||||
[[ 1.51999998e+00, 2.81999993e+00, 2.14000010e+00],
|
[[ 1.51999998e+00, 2.81999993e+00, 2.14000010e+00],
|
||||||
[ 1.09999990e+00, 2.04999971e+00, 1.54999995e+00],
|
[ 1.09999990e+00, 2.04999995e+00, 1.54999995e+00],
|
||||||
[ 9.00000036e-01, 1.54999995e+00, 1.25000000e+00]]))
|
[ 9.00000036e-01, 1.54999995e+00, 1.25000000e+00]]))
|
||||||
>>>
|
>>>
|
||||||
>>> class GradNetWithWrtParams(nn.Cell):
|
>>> class GradNetWithWrtParams(nn.Cell):
|
||||||
|
|
Loading…
Reference in New Issue