def test_box_encode_op():
    anchors = mx.nd.array([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]]).reshape((1, -1, 4))
    refs = mx.nd.array([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]]).reshape((1, -1, 4))
    samples = mx.nd.array([[0, 1]])
    matches = mx.nd.array([[0, 1]])
    means = mx.nd.array([0.0, 0.0, 0.0, 0.0])
    stds = mx.nd.array([0.1, 0.1, 0.2, 0.2])
    Y, mask = mx.nd.contrib.box_encode(samples, matches, anchors, refs, means, stds)
    assert_allclose(Y.asnumpy(), np.zeros((1, 2, 4)), atol=1e-5, rtol=1e-5)
    assert_allclose(mask.asnumpy(), np.array([[[0., 0., 0., 0.], [1., 1., 1., 1.]]]), atol=1e-5, rtol=1e-5)