def get_resblock(model, layer_name):
    """
    model is a class resnet
    e.g. layer_name is "layer1.0.relu2"
    """
    obj_name, b_idx, act_name = layer_name.split(".")
    b_idx = int(b_idx)
    block = getattr(model, obj_name)[b_idx]
    return block