MCPcopy Create free account
hub / github.com/clab/dynet / add_function_node

Method add_function_node

dynet/dynet.cc:117–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117VariableIndex ComputationGraph::add_function_node(Node *node, Device *device) {
118 VariableIndex new_node_index((VariableIndex)nodes.size());
119 nodes.push_back(node);
120 if (node->device == nullptr) {
121 if (node->arity() > 0) {
122 node->device = nodes[node->args[0]]->device;
123 } else {
124 node->device = device == nullptr ? dynet::default_device : device;
125 }
126 }
127 if (node->device->type == DeviceType::GPU && !node->has_cuda_implemented)
128 DYNET_NO_CUDA_IMPL_ERROR(node->as_dummy_string())
129 set_dim_for_new_node(new_node_index);
130 return new_node_index;
131}
132
133CGCheckpoint ComputationGraph::_get_checkpoint() {
134 CGCheckpoint p;

Callers

nothing calls this directly

Calls 3

arityMethod · 0.80
as_dummy_stringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected