上传者: 38681286
|
上传时间: 2021-11-29 10:52:10
|
文件大小: 27KB
|
文件类型: -
import numpy as np
import torch
from torch import nn, optim
import torch.nn.functional as F
载入数据
import sys
sys.path.append(../input/)
import d2l_jay9460 as d2l
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
(corpus_indices, char_to_idx, idx_to_char, vocab_size) = d2l.load_