function getAxesPermutation(axes, rank) {
	  if (axesAreInnerMostDims(axes, rank)) {
	    return null;
	  }

	  var result = [];

	  for (var i = 0; i < rank; ++i) {
	    if (axes.indexOf(i) === -1) {
	      result.push(i);
	    }
	  }

	  axes.forEach(function (axis) {
	    return result.push(axis);
	  });
	  return result;
	}
Returns the axes permutation to be used with `tf.transpose`, if such
permutation is necessary. Otherwise it returns null. This method is used by
operations that operate only on inner-most axes.