Utils

train.utils.check_shape(a, b)[source]

Check if the shapes of given values match.

Parameters:
  • a (array_like, tuple) – An object with shape attribute or a tuple representing shape.
  • b (array_like, tuple) – An object with shape attribute or a tuple representing shape.
Raises:

Exception – When shapes don’t match.

train.utils.zeros_like(a, dtype='float32')[source]

Return an array of zeros with same shape as given array.

Parameters:a (array_like, iterable) – An object with shape attribute or an iterable.
Returns:Array of zeros with the same shape as a.
Return type:(array_like, list)