Implement a custom multidimensional convolution operator in Python without relying on high-level deep learning frameworks.