This file contains 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 torch | |
import numpy as np | |
from matplotlib import pyplot as plt | |
torch.set_printoptions(precision=10) | |
class ResidualBlock(torch.nn.Module): | |
def __init__(self, dims, bottleneck): | |
super(ResidualBlock, self).__init__() | |
self.linear1 = torch.nn.Linear(dims, bottleneck) |
This file contains 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
#pragma once | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <unordered_map> | |
#include <string> | |
#include <variant> | |
using Key = std::string; | |
using Value = std::variant<std::string, double, bool>; |
This file contains 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
s = input() | |
prevs = dict() | |
a = [] | |
for i in range(len(s)): | |
if s[i] in prevs: | |
a.append(i - prevs[s[i]]) | |
else: | |
a.append(i + 1) | |
prevs[s[i]] = i |
This file contains 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
root = "cargo" | |
[packages] | |
[packages.bitflags] | |
dependencies = [] | |
path = "/Users/winger/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.1.1" | |
version = "0.1.1" | |
[packages.cargo] |