def is_trainable(coeff):
    """
    Check if a coefficient is trainable. This is done by seeing if the tensor has the 'trainable'
    attribute and it is True. tf.constant's do not have this attribute
    """
    return getattr(coeff, 'trainable', False)