(source)
return None
Crawl around the transforms attached to a dataset looking for
    the last crop or resize transform to return.
Crawl around the transforms attached to a dataset looking for
    the last crop or resize transform to return.
Crawl around the transforms attached to a dataset looking for the last crop or resize transform to return .
def find_sizer(source):
    '''
    Crawl around the transforms attached to a dataset looking for
    the last crop or resize transform to return.
    '''
    if source is None:
        return None
    if isinstance(source, (transforms.Resize, transforms.RandomCrop,
        transforms.RandomResizedCrop, transforms.CenterCrop)):
        return source
    t = getattr(source, 'transform', None)
    if t is not None:
        return find_sizer(t)
    ts = getattr(source, 'transforms', None)
    if ts is not None:
        for t in reversed(ts):
            result = find_sizer(t)
            if result is not None:
                return result
    return None
def find_sizer ( source ) : if source is None : return None if isinstance ( source , ( transforms . Resize , transforms . RandomCrop , transforms . RandomResizedCrop , transforms . CenterCrop ) ) : return source t = getattr ( source , 'transform' , None ) if t is not None : return find_sizer ( t ) ts = getattr ( source , 'transforms' , None ) if ts is not None : for t in reversed ( ts ) : result = find_sizer ( t ) if result is not None : return result return None