cost 252 ms
将一个张量的值添加到另一个而不影响图形 - Add values of one tensor to another without affecting the graph

我只是想将tensor2的第三维的前三个值添加到tensor1,而不影响反向传播时的图形。 Tensor2 只需要它的值,它不应该是图表的一部分。 这行得通吗? 这就是我在 numpy 中的做法。 我应该更好地使用 torch.add() 还是 use.data? 我对何时使用什么感到困惑。 谢谢 ...

如何使用批处理文件来做一个涉及百分比的数学题,然后加上一个小数? - How to use batch file to do a math problem involving a percentage and a adding a decimal number after that?

我做了很多研究,在 BAT 文件中似乎不可能乘以 % 百分比? 例如,我想要完成的是要求用户输入一个数字(我们称之为 A ) 然后将该数字乘以设定的百分比数字,然后将类似 .41 的内容添加到总数中所以简单数学中的方程式是 a*xx%+.41=??? 但我还没有找到在 BAT 文件中执行此操作的方 ...

我们不能将字符串转换为 Integer 并同时将其添加到其他整数并检查 if 条件是否等于另一个 integer 吗? - Can't we convert string into Integer and add it to other Integers at the same time and check in a if condition if it equals another integer?

我在 Codechef 上解决一个问题,我遇到了这个问题。 这是问题的链接。 https://www.codechef.com/LP0TO101/problems/FLOW013 基本上我们有三个角,我们需要检查它们的和是否为 180,因此它是一个三角形,如果是,我们需要打印 YES,否则我们需 ...

如何改变向量V的所有元素来达到sum(V)等于上下边界的条件? - How to change all elements of a vector V to achieve the condition sum(V) equal with a upper and lower boundaries?

我有一个矢量 V,例如V=[0.1 0.002 0.5 0.2 0.1 0.003 0.4] 。 矩阵 V 所有元素的边界应始终介于0.01和0.8之间我想创建一个 function 来更改向量V的元素,其中 V 的总和等于 1。 我希望在 Matlab 中创建一个Matlab V= Editor ...

Dafny:验证最简单的数组求和是行不通的。 有人可以向我解释为什么吗? - Dafny: Verification of the most simple array summation does not work. Can somebody explain me why?

当我有三个 arrays 和 c[j]:= b[h] + a[i] 时。 验证 c[j] == b[h] + a[i] 不起作用。 有人可以解释一下为什么吗? 确保所有索引都在范围内并且所有三个 arrays 都是 int arrays。这是我的代码: 我希望“确保”这一行是真实的。 但是 Daf ...

将 R 中矩阵的下三角和上三角相加 - Summing together the lower triangle and the upper triangle of a matrix in R

我有一个矩阵,其中 row_names 和 col_names 是相同的。 填充矩阵的值不是对称的(即上三角和下三角不同)。 对角线用 0 填充。 我想将上三角与下三角相加。 我不介意 output 是什么格式:要么是 rownames-colnames-newvalues 的 data.table ...

有没有办法在 2 个函数 onclick 之间切换,以便第一个函数加在一起,第二个函数减去变量? - Is there a way to switch between 2 functions onclick so that the first one adds together and a second one subtracts variables?

所以基本上我想制作一个程序,在 HTML 中有 2 个输入和一个按钮。第一个输入将是起始值(stvalue) ,第二个将是添加/减去的值(value)和 output 和(sum)那会不断变化。 因此,当我输入 2 个值(stvalue)和(value)并单击按钮时,它会首先将它们加在一起(sum ...

System.FormatException:输入字符串的格式不正确。 c# - System.FormatException: Input string was not in a correct format. c#

对不起,如果它是重复的。 我什至不知道该写什么作为标题。 介绍: 我试图将加法器作为控制台应用程序。 问题: 当我运行程序时,一切正常,直到第 24 行。 它会显示一个错误。 (图 1) 我尝试了什么: 没有什么。 当我查看代码时,我没有看到任何错误。 谢谢代码: 对不起,我是捷克人,我在捷克有 ...

在我的函数中传递变量时,我的输出没有打印出相同的值 - My output isn't printing out the same value when passing through variables in my function

与我编写的其他代码相比,我无法理解为什么我的代码没有打印出来。 上面的代码仅在我传递值时打印 None 而下面的代码打印所需的结果。 我能解释一下为什么会这样吗? 提前非常感谢。 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM