本文整理汇总了Python中tensorflow.python.ops.nn_ops.depthwise_conv2d_native_backprop_input函数的典型用法代码示例。如果您正苦于以下问题:Python depthwise_conv2d_native_backprop_input函数的具体用法?Python depthwise_conv2d_native_backprop_input怎么用?Python depthwise_conv2d_native_backprop_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了depthwise_conv2d_native_backprop_input函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _GetVal
def _GetVal(use_xla):
with self.test_session():
t0 = constant_op.constant(input_sizes, shape=[len(input_sizes)])
t1 = array_ops.placeholder(np.float32, shape=filter_sizes)
t2 = array_ops.placeholder(np.float32, shape=output_sizes)
if use_xla:
with self.test_scope():
backprop = nn_ops.depthwise_conv2d_native_backprop_input(
t0, t1, t2, strides=[1, stride, stride, 1], padding=padding)
else:
backprop = nn_ops.depthwise_conv2d_native_backprop_input(
t0, t1, t2, strides=[1, stride, stride, 1], padding=padding)
ret = backprop.eval({t1: x1, t2: x2})
self.assertShapeEqual(ret, backprop)
return ret
开发者ID:Brandon1016,项目名称:tensorflow,代码行数:16,代码来源:depthwise_conv_op_test.py
示例2: _DepthwiseConv2dNativeGrad
def _DepthwiseConv2dNativeGrad(op, grad):
return [
nn_ops.depthwise_conv2d_native_backprop_input(
array_ops.shape(op.inputs[0]), op.inputs[1], grad,
op.get_attr("strides"), op.get_attr("padding")),
nn_ops.depthwise_conv2d_native_backprop_filter(
op.inputs[0], array_ops.shape(op.inputs[1]), grad,
op.get_attr("strides"), op.get_attr("padding"))
]
开发者ID:Jackhuang945,项目名称:tensorflow,代码行数:9,代码来源:nn_grad.py
示例3: _GetVal
def _GetVal(use_gpu):
with self.cached_session(use_gpu=use_gpu):
t0 = constant_op.constant(input_sizes, shape=[len(input_sizes)])
t1 = constant_op.constant(x1, shape=filter_sizes)
t2 = constant_op.constant(x2, shape=output_sizes)
backprop = nn_ops.depthwise_conv2d_native_backprop_input(
t0, t1, t2, strides=[1, stride, stride, 1], padding=padding)
ret = self.evaluate(backprop)
self.assertShapeEqual(ret, backprop)
return ret
开发者ID:bunbutter,项目名称:tensorflow,代码行数:10,代码来源:depthwise_conv_op_test.py
示例4: _DepthwiseConv2dNativeBackpropFilterGrad
def _DepthwiseConv2dNativeBackpropFilterGrad(op, grad):
return [
nn_ops.depthwise_conv2d_native_backprop_input(
array_ops.shape(op.inputs[0]),
grad,
op.inputs[2],
dilations=op.get_attr("dilations"),
strides=op.get_attr("strides"),
padding=op.get_attr("padding"),
data_format=op.get_attr("data_format")), None,
nn_ops.depthwise_conv2d_native(
op.inputs[0],
grad,
dilations=op.get_attr("dilations"),
strides=op.get_attr("strides"),
padding=op.get_attr("padding"),
data_format=op.get_attr("data_format"))
]
开发者ID:adit-chandra,项目名称:tensorflow,代码行数:18,代码来源:nn_grad.py
注:本文中的tensorflow.python.ops.nn_ops.depthwise_conv2d_native_backprop_input函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论