qml.interfaces.tf.unflatten_tf

unflatten_tf(flat, model)[source]

Restores an arbitrary nested structure to a flattened TF tensor.

See also unflatten().

Parameters
  • flat (tf.Tensor) – 1D tensor of items

  • model (array, Iterable, Number) – model nested structure

Returns

first elements of flat arranged into the nested structure of model, unused elements of flat

Return type

Union[tf.Tensor, list], array

Raises

TypeError – if model contains an object of unsupported type