function getBroadcastDims(inShape, outShape) {
	  var inRank = inShape.length;
	  var dims = [];

	  for (var i = 0; i < inRank; i++) {
	    var dim = inRank - 1 - i;
	    var a = inShape[dim] || 1;
	    var b = outShape[outShape.length - 1 - i] || 1;

	    if (b > 1 && a === 1) {
	      dims.unshift(dim);
	    }
	  }

	  return dims;
	}
Returns the dimensions in the input shape that are broadcasted to
produce the provided output shape.

The returned dimensions are 0-indexed and sorted. An example:
inShape = [4, 1, 3]
outShape = [5, 4, 3, 3]
result = [1]. Dimension 1 (2nd dimension of input) gets broadcasted 1 => 3.