MCPcopy Create free account
hub / github.com/apache/singa / Backward

Method Backward

src/model/layer/split.cc:43–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43const std::pair<vector<Tensor>, vector<Tensor>> Split::Backward(
44 int flag, const vector<Tensor>& grads) {
45 vector<Tensor> input_grad, param_grad;
46 CHECK_EQ(grads.size(), output_size_);
47
48 /// Input_grad is the sum of all the output gradients.
49 Tensor temp = grads.at(0);
50 for (size_t i = 1; i < output_size_; i++)
51 temp += grads.at(i);
52 input_grad.push_back(temp);
53 return std::make_pair(input_grad, param_grad);
54}
55
56} // namespace singa

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected