def reverse_str(s): from functools import reduce res = s[::-1] # 切片 res = "".join(list(reversed(s))) # 反转函数 res = reduce(lambda x,y:y+x, s) # reduce p ...
分类:
其他好文 时间:
2021-04-28 12:06:36
阅读次数:
0
Flink处理函数实战之五:CoProcessFunction(双流处理) 欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java、Docker、Kubernetes、DevOPS等; 欢迎访问我的Git ...
分类:
其他好文 时间:
2021-04-28 12:02:58
阅读次数:
0
nn.Module 函数详解 nn.Module是所有网络模型结构的基类,无论是pytorch自带的模型,还是要自定义模型,都需要继承这个类。这个模块包含了很多子模块,如下所示,_parameters存放的是模型的参数,_buffers也存放的是模型的参数,但是是那些不需要更新的参数。带hook的都 ...
分类:
其他好文 时间:
2021-04-28 11:52:07
阅读次数:
0
python组合数据类型 序列类型 列表(list) 性质 可修改 可重复 可嵌套 有序 构造列表 [,] list() 不带参数进行调用时将返回一个空列表,带一个list参数时,返回该参数的浅拷贝;对任意其他参数,则尝试将给定的 对象转换为列表。该函数只接受一个参数的情况。 [expression ...
分类:
编程语言 时间:
2021-04-28 11:49:14
阅读次数:
0
pytest中参数化首先需要导入pytest包import pytest @pytest.mark.parametrize(‘a,b,c’,[列表or元组])通过元组与列表传入数据,示例如下: 注意:parametrize可以用来声明变量,函数在使用变量时传参的值要和声明的值一致,执行后我们可以看到 ...
分类:
其他好文 时间:
2021-04-28 11:43:04
阅读次数:
0
// ts版-vue private justPalyOne() { const audios = document.querySelectorAll("audio"); // 暂停函数 const pauseAll = (exclude: any): any => { audios.forEach ...
分类:
其他好文 时间:
2021-04-27 15:20:20
阅读次数:
0
默认构造函数是可以不用实参数来进行的构造函数它包括了两种 1.没有带明显形参的构造函数 2.提供了默认形参的构造函数 类设计者可以自己写一个默认构造函数,编译器帮我们写的默认构造函数称为合成的默认构造函数,编译器总会给我们的构造函数增加一个隐含的this指针,所以本质上,是没有不带形参的构造函数的。 ...
分类:
其他好文 时间:
2021-04-27 15:18:14
阅读次数:
0
思路: 水题,略过 Tip: 无 #include <bits/stdc++.h> using namespace std; int main() { int n, t, num = 0; string now; cin >> n >> t; getchar(); for (int i = 1; i ...
分类:
其他好文 时间:
2021-04-27 15:16:28
阅读次数:
0
思路: 水题,略过 Tip: 无 #include <bits/stdc++.h> using namespace std; const int maxn = 1000 + 5; int ans[maxn]; int main() { int a, b, n; cin >> a >> b >> n; ...
分类:
其他好文 时间:
2021-04-27 15:09:43
阅读次数:
0
思路: 水题,略过 Tip: 无 #include <bits/stdc++.h> using namespace std; const int maxn = 1000 + 5; queue<char> que[maxn]; stack<char> s; int main() { int n, m, ...
分类:
其他好文 时间:
2021-04-27 15:08:37
阅读次数:
0