算法
文章平均质量分 51
weixin_41318625
这个作者很懒,什么都没留下…
展开
-
heapq
heapq原创 2022-05-31 17:15:29 · 415 阅读 · 0 评论 -
autograd error
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.LongTensor [896, 1]] is at version 11539; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed原创 2022-04-03 15:41:55 · 384 阅读 · 0 评论 -
python--leetcode 双指针技巧秒杀七道链表题目
合并K个升序链表 给你一个链表数组,每个链表都已经按升序排列。 请你将所有链表合并到一个升序链表中,返回合并后的链表。 使用小跟堆(https://labuladong.gitee.io/algo/2/22/64/) 以及python 标准库 heapq (https://www.jianshu.com/p/801318c77ab5) nums = [2, 3, 5, 1, 54, 23, 132] heap = [] for num in nums: heapq.heappush(heap, .原创 2022-03-30 16:45:11 · 1577 阅读 · 0 评论