prepend_dims

tfsnippet.ops.prepend_dims(x, ndims=1, name=None)

Prepend [1] * ndims to the beginning of the shape of x.

Parameters:
  • x – The tensor x.
  • ndims – Number of 1 to prepend.
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

The tensor with prepended dimensions.

Return type:

tf.Tensor