function createArray (arr, dtype) {
  if (arr instanceof NdArray) { return arr; }
  var T = _.getType(dtype);
  if (_.isNumber(arr)) {
    if (T !== Array) {
      return new NdArray(new T([arr]), [1]);
    } else {
      return new NdArray([arr], [1]);
    }
  }
  var shape = _.getShape(arr);
  if (shape.length > 1) {
    arr = _.flatten(arr, true);
  }
  if (!(arr instanceof T)) {
    arr = new T(arr);
  }
  return new NdArray(arr, shape);
}
Returns the discrete, linear convolution of the array using the given filter.

@note: Arrays must have the same dimensions and `filter` must be smaller than the array.
@note: The convolution product is only given for points where the signals overlap completely. Values outside the signal boundary have no effect. This behaviour is known as the 'valid' mode.
@note: Use optimized code for 3x3, 3x3x1, 5x5, 5x5x1 filters, FFT otherwise.

@param {Array|NdArray} filter