ee8ff00a2a8a307c952fb8e7bef241188c7fb12b,keras/backend/tensorflow_backend.py,,pool2d,#Any#Any#Any#Any#Any#Any#,1048
Before Change
// TF input shape: (samples, rows, cols, input_depth)
// TH kernel shape: (depth, input_depth, rows, cols)
// TF kernel shape: (rows, cols, input_depth, depth)
x = tf.transpose(x, (0, 2, 3, 1))
if pool_mode == "max":
x = tf.nn.max_pool(x, pool_size, strides, padding=padding)
elif pool_mode == "avg":
x = tf.nn.avg_pool(x, pool_size, strides, padding=padding)
else:
raise Exception("Invalid pooling mode: " + str(pool_mode))
if dim_ordering == "th":
x = tf.transpose(x, (0, 3, 1, 2))
else:
raise Exception("Unknown dim_ordering: " + str(dim_ordering))
if _FLOATX == "float64":
x = tf.cast(x, "float64")
return x
// RANDOMNESS
After Change
dim_ordering: one of "th", "tf".
pool_mode: one of "max", "avg".
"""
if dim_ordering not in {"th", "tf"}:
raise Exception("Unknown dim_ordering " + str(dim_ordering))
padding = _preprocess_border_mode(border_mode)
strides = (1,) + strides + (1,)
pool_size = (1,) + pool_size + (1,)
x = _preprocess_conv2d_input(x, dim_ordering)
if pool_mode == "max":
x = tf.nn.max_pool(x, pool_size, strides, padding=padding)
elif pool_mode == "avg":
x = tf.nn.avg_pool(x, pool_size, strides, padding=padding)
else:
raise Exception("Invalid pooling mode: " + str(pool_mode))
return _postprocess_conv2d_output(x, dim_ordering)
def pool3d(x, pool_size, strides=(1, 1, 1), border_mode="valid",
dim_ordering=_IMAGE_DIM_ORDERING, pool_mode="max"):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: keras-team/keras
Commit Name: ee8ff00a2a8a307c952fb8e7bef241188c7fb12b
Time: 2016-07-03
Author: francois.chollet@gmail.com
File Name: keras/backend/tensorflow_backend.py
Class Name:
Method Name: pool2d
Project Name: chainer/chainercv
Commit Name: b776ae08e9e676435c5cf8d1f31a86dfd3e1897f
Time: 2018-10-20
Author: yuyuniitani@gmail.com
File Name: chainercv/utils/image/read_image.py
Class Name:
Method Name: read_image
Project Name: chainer/chainercv
Commit Name: 140b558954c61e77551ff93545864b78b086e1b1
Time: 2019-01-28
Author: 69guitar1015@gmail.com
File Name: chainercv/utils/image/read_label.py
Class Name:
Method Name: read_label