pixelcnn_2d_sample

tfsnippet.ops.pixelcnn_2d_sample(fn, inputs, height, width, channels_last=True, start=0, end=None, back_prop=False, parallel_iterations=1, swap_memory=False, name=None)

Sample output from a PixelCNN 2D network, pixel-by-pixel.

Parameters:
  • fn(i: tf.Tensor, inputs: tuple[tf.Tensor]) -> tuple[tf.Tensor], the function to derive the outputs of PixelCNN 2D network at iteration i. inputs are the pixel-by-pixel outputs gathered through iteration 0 to iteration i - 1. The iteration index i may range from 0 to height * width - 1.
  • inputs (Iterable[tf.Tensor]) – The initial input tensors. All the tensors must be at least 4-d, with identical shape.
  • height (int or tf.Tensor) – The height of the outputs.
  • width (int or tf.Tensor) – The width of the outputs.
  • channels_last (bool) – Whether or not the channel axis is the last axis in input? (i.e., the data format is “NHWC”)
  • start (int or tf.Tensor) – The start iteration, default 0.
  • end (int or tf.Tensor) – The end (exclusive) iteration. Default height * width.
  • parallel_iterations, swap_memory (back_prop,) – Arguments passed to tf.while_loop().
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The final outputs.

Return type:

tuple[tf.Tensor]