MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / reducer

Function reducer

tensorflow/python/ops/image_ops_impl.py:3289–3294  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

3287 # TODO(sjhwang): Gaussian kernel is separable in space. Consider applying
3288 # 1-by-n and n-by-1 Gaussain filters instead of an n-by-n filter.
3289 def reducer(x):
3290 shape = array_ops.shape(x)
3291 x = array_ops.reshape(x, shape=array_ops.concat([[-1], shape[-3:]], 0))
3292 y = nn.depthwise_conv2d(x, kernel, strides=[1, 1, 1, 1], padding='VALID')
3293 return array_ops.reshape(
3294 y, array_ops.concat([shape[:-3], array_ops.shape(y)[1:]], 0))
3295
3296 luminance, cs = _ssim_helper(img1, img2, reducer, max_val, compensation, k1,
3297 k2)

Callers 5

testReducerMethod · 0.85
_ssim_helperFunction · 0.85
ReduceFunction · 0.85
ReduceGenericFunction · 0.85
ComputeMethod · 0.85

Calls 3

reshapeMethod · 0.80
shapeMethod · 0.45
concatMethod · 0.45

Tested by 1

testReducerMethod · 0.68