摘要:
给一个张量 索引 index0 index1 index2 index3 index0 0 1 2 3 index1 4 5 6 7 index2 8 9 10 11 index3 12 13 14 15 torch.gather(dim, index) → Tensor 首先dim表示维度,如果d 阅读全文
摘要:
通过三个例子来讲解熵的概念 爸爸需要让小明猜球的颜色,如果猜中了,就停止继续猜,如果没有猜对则一直继续猜。 题目1:爸爸拿来一个箱子,跟小明说:里面有橙、紫、蓝及青四种颜色的小球任意个,各颜色小球的占比不清楚,现在我从中拿出一个小球,你猜我手中的小球是什么颜色? 从上面的图中可以发现,小明首先的假设 阅读全文
摘要:
Given a binary tree root. Split the binary tree into two subtrees by removing 1 edge such that the product of the sums of the subtrees are maximized. 阅读全文
摘要:
Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with a fo 阅读全文
摘要:
Given the root of a binary tree, each node has a value from 0 to 25 representing the letters 'a' to 'z': a value of 0 represents 'a', a value of 1 rep 阅读全文
摘要:
A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles i 阅读全文
摘要:
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bot 阅读全文
摘要:
Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and 阅读全文
摘要:
You are given the root of a binary search tree (BST), where exactly two nodes of the tree were swapped by mistake. Recover the tree without changing i 阅读全文
摘要:
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. You may return the answer in any order. Example 1: Input: n 阅读全文