摘要:
用于截断反向传播 detach()源码: def detach(self): result = NoGrad()(self) # this is needed, because it merges version counters result._grad_fn = None return resu 阅读全文
摘要:
没啥说的,直接上代码 class Solution { public int combinationSum4(int[] nums, int target) { if(nums==null||nums.length==0||target==0) return 0; int[] dp=new int[ 阅读全文
摘要:
有两种解法,一种是求两个单词的最长公共子列,最后结果为m*n-dp[m][n] 其中dp[m][n]表示两个单词的最长公共子列长度 另一种解法是直接算: class Solution { public int minDistance(String word1, String word2) { int 阅读全文