04 2019 档案

摘要:RuntimeError: bool value of Tensor with more than one value is ambiguous 运行下面这段代码的时候出错了,后来网上搜说改成 if w1.grad is not None: 可以通过。 阅读全文
posted @ 2019-04-24 15:47 卷积 阅读(4532) 评论(0) 推荐(0)
摘要:参考:https://pytorch-cn.readthedocs.io/zh/latest/torchvision/torchvision-transform/ 1.pytorch torchvision transform 对PIL.Image进行变换: 2. class torchvision 阅读全文
posted @ 2019-04-22 10:30 卷积 阅读(5510) 评论(0) 推荐(0)
摘要:参考: http://www.runoob.com/python/python-func-isinstance.html isinstance 用来判断一个对象是否是一个已知的类型。 用法: isinstance(object, classinfo) 参数: object--实例对象, classi 阅读全文
posted @ 2019-04-20 11:09 卷积 阅读(133) 评论(0) 推荐(0)
摘要:实现需要以下两点: 1.跟踪树的大小(树的元素个数)。 2.将小树链接到大树上。 代码来自红书:算法(第4版),很简洁。 阅读全文
posted @ 2019-04-13 22:27 卷积 阅读(267) 评论(0) 推荐(0)
摘要:2.新的迭代器 的接口为Iterator类 3.想让自己定义的类支持Foreach循环,需要继承Interable类 阅读全文
posted @ 2019-04-03 21:06 卷积 阅读(305) 评论(0) 推荐(0)