Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torchvision | |
from torchvision import transforms | |
from torch.ao.quantization import get_default_qat_qconfig_mapping | |
from torch.ao.quantization.quantize_fx import prepare_qat_fx, convert_fx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from collections import namedtuple | |
topk_namedtuple = namedtuple('topk_namedtuple', ['values', 'indices']) | |
def topk(array: np.ndarray, k: int, largest: bool = True) -> topk_namedtuple: | |
"""Returns the k largest/smallest elements and corresponding indices | |
from an array-like input. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete local tag '12345' | |
git tag -d <tagname> | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :<tagname> | |
# create local tag | |
git tag <tagname> | |
# push tag to remote | |
git push origin <tagname> |