- 博客(8)
- 收藏
- 关注
原创 pytorch稀疏张量sparse tensor中关于coalesce()的用法
定义一个稀疏tensor,其中可能出现同一个索引对应多个标量: sp_adj = torch.sparse_coo_tensor([[1,1,1,2]], [2,4,6,9], (3,)) print(sp_adj) output:tensor(indices=tensor([[1, 1, 1, 2]]), values=tensor([2, 4, 6, 9]), size=(3,), nnz=4, layout=torch.sparse_coo) coalesce()函数的作
2021-09-27 20:37:22
6057
原创 写论文word转pdf图片失真
写论文word转PDF图片变模糊失真 1. 将图片转为svg格式矢量图 例如python中使用matplotlib画好图之后,将图片保存为.svg格式: plt.savefig("demo.svg".format(model,dataset),dpi=1000,bbox_inches = 'tight') 使用PPT画图时,框选中后右键选择“另存为图片”,选择输出格式为.svg,visio也一样 2. 将svg格式的矢量图直接插入word 3. 直接在word导出pdf格式 ...
2021-03-17 15:39:51
1326
1
原创 tensorflow安装
一键设置pip镜像源 pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
2020-06-23 09:06:18
286
原创 完美解决js提交表单出现about:block空白页
1. js function postToPage(object) { var info = object.getAttribute("value").split("-"); var tid = info[0]; var url = info[1]; var username = document.getElementById("username").value; var f=document.createElement("form"); f.action =
2020-06-20 23:40:00
1773
原创 iframe完美解决自适应内嵌网页高度
1.css iframe { display: block; border: none; height: 90vh;/*设置高度百分比,一直调到只有一个滚动调为止*/ width: 100%; } html <iframe src="https://www.bilibili.com/video/BV1E7411b7QN" width="100%" allowfullscreen frameborder="0"></iframe> 效果 ...
2020-06-19 23:40:04
7101
4
原创 java执行python文件
1.pom文件添加jython依赖 <dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.0</version> </dependency> 2.java代码 pub
2020-06-16 10:25:25
299
原创 Mybatis中sql注解获取函数参数
方式一 使用${value}获取函数的参数值,不添加单引号 //condition = where name = '张三' @Select("SELECT * FROM student ${condition}") List<student> getStudentListByCondition(@Param("condition") String condition); //sql = SELECT * FROM student where name = '张三' 方式二 使用#{value}
2020-05-20 20:55:50
696
原创 python实现快速排序算法
快速排序1.python代码2.测试3.输出 1.python代码 def quickSort(data,left,right): if (right-left) == 1: #待排序集合中只有两个元素,直接比较大小 temp = data[right] if data[left] > data[right]: #左大于右则互换位置 data[left],data[right] = data[right],data[left] elif left<right: #
2020-05-17 23:24:09
231
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅