main.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:examples 作者: pytorch 项目源码 文件源码
def get_batch(source, i, evaluation=False):
    seq_len = min(args.bptt, len(source) - 1 - i)
    data = Variable(source[i:i+seq_len], volatile=evaluation)
    target = Variable(source[i+1:i+1+seq_len].view(-1))
    return data, target
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号