Vikas89 commented on a change in pull request #12558: [MXNET-952] added a line
to check for kernel size and unittest for the same
URL: https://github.com/apache/incubator-mxnet/pull/12558#discussion_r217576278
##########
File path: tests/python/unittest/test_operator.py
##########
@@ -6913,6 +6913,28 @@ def test_invalid_depth_dim():
test_invalid_block_size()
test_invalid_depth_dim()
+@with_seed()
+def test_correlation_kernel_size():
+ import numpy as np
+ import mxnet as mx
+
+ # Network
+ data1 = mx.symbol.Variable('data1')
+ cor = mx.sym.Correlation(data1=data1, data2=data1, kernel_size=28,
stride1=1, stride2=1, pad_size=0, max_displacement=0)
+ loss = mx.sym.MakeLoss(cor, normalization='batch')
+ group = mx.symbol.Group([mx.sym.BlockGrad(cor), loss])
+
+ # Data
+ datashape = (1, 1, 28, 28) # like mnist
+ data = np.random.rand(1, 1, 28, 28)
+
+ #Bind, execute, get computed correlation
+ executor = group.simple_bind(ctx=mx.cpu(), data1=datashape)
+ outs = executor.forward(is_train=True, data1=data)
+ cor = executor.outputs[0]
+ grad1 = executor.outputs[1]
+ print(cor)
Review comment:
print? instead do you want to assert?
Also, I would recommend to add a test case with odd version number
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services