Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
f940b668
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f940b668
编写于
4月 27, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
4月 27, 2020
浏览文件
操作
浏览文件
下载
差异文件
!738 fix issues
Merge pull request !738 from zhaozhenlong/fix-issues-conv2d-example
上级
c47ef8ee
2265669d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
0 deletion
+33
-0
mindspore/ops/operations/nn_ops.py
mindspore/ops/operations/nn_ops.py
+33
-0
未找到文件。
mindspore/ops/operations/nn_ops.py
浏览文件 @
f940b668
...
...
@@ -634,6 +634,12 @@ class Conv2D(PrimitiveWithInfer):
Outputs:
Tensor of shape :math:`(N, C_{out}, H_{out}, W_{out})`.
Examples:
>>> input = Tensor(np.ones([10, 32, 32, 32]), mindspore.float32)
>>> weight = Tensor(np.ones([32, 32, 3, 3]), mindspore.float32)
>>> conv2d = P.Conv2D(out_channel=32, kernel_size=3)
>>> conv2d(input, weight)
"""
@
prim_attr_register
...
...
@@ -1090,6 +1096,13 @@ class Conv2DBackpropInput(PrimitiveWithInfer):
Returns:
Tensor, the gradients of convolution.
Examples:
>>> dout = Tensor(np.ones([10, 32, 30, 30]), mindspore.float32)
>>> weight = Tensor(np.ones([32, 32, 3, 3]), mindspore.float32)
>>> x = Tensor(np.ones([10, 32, 32, 32]))
>>> conv2d_backprop_input = P.Conv2DBackpropInput(out_channel=32, kernel_size=3)
>>> conv2d_backprop_input(dout, weight, F.shape(x))
"""
@
prim_attr_register
...
...
@@ -1262,6 +1275,9 @@ class SoftmaxCrossEntropyWithLogits(PrimitiveWithInfer):
Outputs:
Tuple of 2 Tensor, the loss shape is `(N,)`, and the dlogits with the same shape as `logits`.
Examples:
Please refer to the usage in nn.SoftmaxCrossEntropyWithLogits source code.
"""
@
prim_attr_register
...
...
@@ -1306,6 +1322,9 @@ class SparseSoftmaxCrossEntropyWithLogits(PrimitiveWithInfer):
Outputs:
Tensor, if `is_grad` is False, the output tensor is the value of loss which is a scalar tensor;
if `is_grad` is True, the output tensor is the gradient of input with the same shape as `logits`.
Examples:
Please refer to the usage in nn.SoftmaxCrossEntropyWithLogits source code.
"""
@
prim_attr_register
...
...
@@ -2117,6 +2136,12 @@ class SigmoidCrossEntropyWithLogits(PrimitiveWithInfer):
Outputs:
Tensor, with the same shape and type as input `logits`.
Examples:
>>> logits = Tensor(np.random.randn(2, 3).astype(np.float16))
>>> labels = Tensor(np.random.randn(2, 3).astype(np.float16))
>>> sigmoid = P.SigmoidCrossEntropyWithLogits()
>>> sigmoid(logits, labels)
"""
@
prim_attr_register
...
...
@@ -2471,6 +2496,14 @@ class SparseApplyAdagrad(PrimitiveWithInfer):
Outputs:
Tensor, has the same shape and type as `var`.
Examples:
var = Tensor(np.random.random((3, 3)), mindspore.float32)
accum = Tensor(np.random.random((3, 3)), mindspore.float32)
grad = Tensor(np.random.random((3, 3)), mindspore.float32)
indices = Tensor(np.ones((3,), np.int32))
sparse_apply_ada_grad = P.SparseApplyAdagrad(0.5)
sparse_apply_ada_grad(var, accum, grad, indices)
"""
@
prim_attr_register
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录