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