Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
929a2b4b
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
929a2b4b
编写于
9月 28, 2020
作者:
L
LielinJiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine 2.0 api
上级
6b727e08
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
11 deletion
+12
-11
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+7
-5
python/paddle/nn/functional/vision.py
python/paddle/nn/functional/vision.py
+5
-6
未找到文件。
python/paddle/fluid/layers/nn.py
浏览文件 @
929a2b4b
...
...
@@ -13391,7 +13391,7 @@ def temporal_shift(x, seg_num, shift_ratio=0.25, name=None):
${comment}
Args:
x(
Variable
): ${x_comment}
x(
Tensor
): ${x_comment}
seg_num(int): ${seg_num_comment}
shift_ratio(float): ${shift_ratio_comment}
name(str, optional): For detailed information, please refer
...
...
@@ -13399,7 +13399,7 @@ def temporal_shift(x, seg_num, shift_ratio=0.25, name=None):
None by default.
Returns:
out(
Variable): The temporal shifting result is a tensor variable
with the
out(
Tensor): The temporal shifting result is a tensor
with the
same shape and same data type as the input.
Raises:
...
...
@@ -13408,9 +13408,11 @@ def temporal_shift(x, seg_num, shift_ratio=0.25, name=None):
Examples:
.. code-block:: python
import paddle.fluid as fluid
input = fluid.data(name='input', shape=[None,4,2,2], dtype='float32')
out = fluid.layers.temporal_shift(x=input, seg_num=2, shift_ratio=0.2)
import paddle
import paddle.nn.functional as F
input = paddle.randn([3, 4, 2, 2])
out = F.temporal_shift(x=input, seg_num=2, shift_ratio=0.2)
"""
helper = LayerHelper("temporal_shift", **locals())
check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'temporal_shift')
...
...
python/paddle/nn/functional/vision.py
浏览文件 @
929a2b4b
...
...
@@ -34,7 +34,6 @@ from ...fluid.layers import distribute_fpn_proposals #DEFINE_ALIAS
from
...fluid.layers
import
generate_mask_labels
#DEFINE_ALIAS
from
...fluid.layers
import
generate_proposal_labels
#DEFINE_ALIAS
from
...fluid.layers
import
generate_proposals
#DEFINE_ALIAS
from
...fluid.layers
import
grid_sampler
#DEFINE_ALIAS
from
...fluid.layers
import
image_resize
#DEFINE_ALIAS
from
...fluid.layers
import
prior_box
#DEFINE_ALIAS
from
...fluid.layers
import
prroi_pool
#DEFINE_ALIAS
...
...
@@ -74,7 +73,7 @@ __all__ = [
'generate_mask_labels'
,
'generate_proposal_labels'
,
'generate_proposals'
,
'grid_sample
r
'
,
'grid_sample'
,
'image_resize'
,
'image_resize_short'
,
# 'multi_box_head',
...
...
@@ -304,13 +303,13 @@ def grid_sample(x,
# [ 0.596 0.38 0.52 0.24 ]]]]
"""
helper
=
LayerHelper
(
"grid_sample"
,
**
locals
())
check_variable_and_dtype
(
x
,
'x'
,
[
'float32'
,
'float64'
],
'grid_sample
r
'
)
check_variable_and_dtype
(
x
,
'x'
,
[
'float32'
,
'float64'
],
'grid_sample'
)
check_variable_and_dtype
(
grid
,
'grid'
,
[
'float32'
,
'float64'
],
'grid_sample
r
'
)
'grid_sample'
)
if
not
isinstance
(
x
,
Variable
):
raise
ValueError
(
"The x should be a
Variable
"
)
raise
ValueError
(
"The x should be a
Tensor
"
)
if
not
isinstance
(
grid
,
Variable
):
raise
ValueError
(
"The grid should be a
Variable
"
)
raise
ValueError
(
"The grid should be a
Tensor
"
)
_modes
=
[
'bilinear'
,
'nearest'
]
_padding_modes
=
[
'zeros'
,
'reflection'
,
'border'
]
if
mode
not
in
_modes
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录