qml.templates.utils.check_shapes

check_shapes(inpt_list, target_shapes, msg, bounds=None)[source]

Check that the shape of elements in the inpt list are equal to the shapes of elements in the target_shapes list.

Parameters
  • inpt_list (list) – list of elements of which to check the shape

  • target_shapes (list) – list of target shapes, of same length as inpt_list

  • msg (str) – error message to display

  • bounds (list) – list of ‘max’ or ‘min’, indicating the bound that the target shape imposes on the input shape

Returns

list of shapes for inpt_list

Return type

list

Raises

ValueError