Hello, thanks for your great work!
I want to ask you a question: In lib/models/cell_searchs/search_cells.py, line58, the weighted-sum in Gumbel-softmax is calculated as follows: weigsum = sum( weights[_ie] * edge(nodes[j]) if _ie == argmaxs else weights[_ie] for _ie, edge in enumerate(self.edges[node_str]) ). weights[_ie] * edge(nodes[j]) is tensor but weights[_ie] is scalar. weights[_ie] does not multiply with a tensor like edge(nodes[j]). So weights[_ie] * edge(nodes[j]) and weights[_ie] do not have the same dimension.
However, codeweigsum = sum( weights[_ie] * edge(nodes[j]) if _ie == argmaxs else weights[_ie] for _ie, edge in enumerate(self.edges[node_str]) ) is all right when running. Why weights[_ie] * edge(nodes[j]) and weights[_ie] can be added together even if both dimensions(data.shape) are different ?
First of all, thanks for using my repo.
In PyTorch, the operations on tensor can support broadcast for */+, if you add/multiply a scalar with a tensor, it is ok.
Hello, thanks for your great work! I want to ask you a question: In
lib/models/cell_searchs/search_cells.py, line58
, the weighted-sum in Gumbel-softmax is calculated as follows:weigsum = sum( weights[_ie] * edge(nodes[j]) if _ie == argmaxs else weights[_ie] for _ie, edge in enumerate(self.edges[node_str]) )
.weights[_ie] * edge(nodes[j])
is tensor butweights[_ie]
is scalar.weights[_ie]
does not multiply with a tensor likeedge(nodes[j])
. Soweights[_ie] * edge(nodes[j])
andweights[_ie]
do not have the same dimension.However, code
weigsum = sum( weights[_ie] * edge(nodes[j]) if _ie == argmaxs else weights[_ie] for _ie, edge in enumerate(self.edges[node_str]) )
is all right when running. Whyweights[_ie] * edge(nodes[j])
andweights[_ie]
can be added together even if both dimensions(data.shape) are different ?Looking forward to your reply thanks.