4 Star 1 Fork 0

Green/encrypted-traffic-analysis-2021

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tmp.py 993 Bytes
一键复制 编辑 原始数据 按行查看 历史
# %%
import torch
from torch import nn, Tensor, optim
from torch.autograd import Variable
from typing import (
TypeVar, Type, Union, Optional, Any,
List, Dict, Tuple, Callable, NamedTuple
)
import numpy as np
import random
import time
import os
import copy
import re
import logging
from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
import itertools
from utils import Args, D, timeit
logger = logging.getLogger(__name__)
logging.basicConfig(
level=10, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s')
a = [(1.4, 2), (3, 4), (5, 6)]
b = 4
_a = Tensor(a).t()
_b = Tensor(b)
_c = copy.deepcopy(_a)
_m = torch.stack((_a, _c))
print(_m)
# print(torch.stack((1,2,3,4)))
x = Tensor([1, 2])
print(torch.unsqueeze(x, 0))
print(torch.unsqueeze(x, 1))
# print(torch.unsqueeze(x, 1))
y = Tensor([
[1,2,3,4,5],
[6,7,8,9,10]
])
import torch.nn.functional as F
L=10
Y=F.pad(y,(0,L-y.shape[1]),"constant",value=0)
print(Y)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bitosky/encrypted-traffic-analysis-2021.git
git@gitee.com:bitosky/encrypted-traffic-analysis-2021.git
bitosky
encrypted-traffic-analysis-2021
encrypted-traffic-analysis-2021
master

搜索帮助