def check_valid_image(self, data):
    'Checks if the input data is valid'
    if (len(data[0].shape) == 0):
        raise RuntimeError('Data shape is wrong')
Checks if the input data is valid
def check_valid_image(self, data):
    
    if (len(data[0].shape) == 0):
        raise RuntimeError('Data shape is wrong')