backward函数 官方定义: torch.autograd.backward(tensors, grad_tensors=None, retain_graph=None, create_graph=False, grad_variables=None) Computes the sum of gradients of given tensors w.r.t. graph leaves.The graph is differentiated using the chain rule. If a…
author:headsen chen date: 2018-03-21 17:42:13 notice:This article created by headsen chen himself and not allowed to copy,or you will count law question and to pay 10000$!!! 1,直接调用函数名的执行: 2,在return中的执行: 执行结果如下: 3,在print里面执行1:不带参数的单一函数执行:print(f()…
三元运算 三元运算(三目运算),是对简单的条件语句的缩写 # 书写格式 result = 值1 if 条件 else 值2 # 如果条件成立,那么将 “值1” 赋值给result变量,否则,将“值2”赋值给result变量 基本数据类型补充 set set集合,是一个无序且不重复的元素集合 class set(object): """ set() -> new empty set object set(iterable) -> new set object Bui…