def format_torch_name(name):
    """ Formats a torch layer name into a caffe2 blob name """
    name = name.replace('.', '_')

    if name.endswith('bias'):
        name = name[:-4] + 'b'

    if name.endswith('weight'):
        name = name[:-6] + 'w'

    return name