function toPixels(_x, _x2) {
	  return _toPixels.apply(this, arguments);
	}
Draws a `tf.Tensor` of pixel values to a byte array or optionally a
canvas.

When the dtype of the input is 'float32', we assume values in the range
[0-1]. Otherwise, when input is 'int32', we assume values in the range
[0-255].

Returns a promise that resolves when the canvas has been drawn to.

@param img A rank-2 or rank-3 tensor. If rank-2, draws grayscale. If
    rank-3, must have depth of 1, 3 or 4. When depth of 1, draws
grayscale. When depth of 3, we draw with the first three components of
the depth dimension corresponding to r, g, b and alpha = 1. When depth of
4, all four components of the depth dimension correspond to r, g, b, a.
@param canvas The canvas to draw to.

@doc {heading: 'Browser', namespace: 'browser'}