neuralib.util.utils.cls_hasattr

neuralib.util.utils.cls_hasattr(cls, attr)[source]

Check if attributes in class

Parameters:
  • cls (type) – The class to check for the attribute.

  • attr (str) – The name of the attribute to look for within the class and its hierarchy.

Returns:

True if the class or any of its parent classes has the specified attribute, False otherwise.

Return type:

bool