Skip to content

Instantly share code, notes, and snippets.

@jamesr66a
Created December 17, 2018 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesr66a/85ee59c0a99c669f83c5a4498884dd27 to your computer and use it in GitHub Desktop.
Save jamesr66a/85ee59c0a99c669f83c5a4498884dd27 to your computer and use it in GitHub Desktop.
x tensor([[-0.0052, 0.0273, -0.0487, -0.0387, -0.0410]], dtype=torch.float32)
w tensor([[ -95, -11, -36, 60, -30],
[ 83, 127, -109, 46, -54],
[-128, -91, -12, 101, -98],
[ -83, -29, -6, -105, 95],
[ 99, -6, 48, 29, -87]], dtype=torch.int8)
zero_point -2
scale 0.003393471473827958
calc w tensor([[-0.3156, -0.0305, -0.1154, 0.2104, -0.0950],
[ 0.2884, 0.4378, -0.3631, 0.1629, -0.1765],
[-0.4276, -0.3020, -0.0339, 0.3495, -0.3258],
[-0.2749, -0.0916, -0.0136, -0.3495, 0.3292],
[ 0.3427, -0.0136, 0.1697, 0.1052, -0.2884]], dtype=torch.float32)
w32 Parameter containing:
tensor([[-0.3154, -0.0306, -0.1157, 0.2098, -0.0943],
[ 0.2889, 0.4385, -0.3616, 0.1619, -0.1773],
[-0.4268, -0.3030, -0.0345, 0.3496, -0.3246],
[-0.2765, -0.0932, -0.0142, -0.3502, 0.3302],
[ 0.3415, -0.0135, 0.1684, 0.1064, -0.2871]], dtype=torch.float32)
b tensor([-0.0984, 0.1139, 0.3122, 0.0006, -0.1556], dtype=torch.float32,
requires_grad=True)
y tensor([[-0.1012, 0.1320, 0.2986, -0.0043, -0.1544]], dtype=torch.float32)
y_ref tensor([[-9.6206e-02, 1.4302e-01, 3.0760e-01, 1.6042e-04, -1.5829e-01]],
dtype=torch.float32)
diff tensor([[-0.0050, -0.0111, -0.0090, -0.0045, 0.0039]], dtype=torch.float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment