MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / translate_node

Function translate_node

flow-rs/src/config/mod.rs:46–72  ·  view source on GitHub ↗
(
    local_key: u64,
    is_shared: bool,
    p: presentation::Node,
)

Source from the content-addressed store, hash-verified

44];
45
46fn translate_node(
47 local_key: u64,
48 is_shared: bool,
49 p: presentation::Node,
50) -> Result<interlayer::Node> {
51 let ty = p.entity.ty.split('|').next().unwrap().trim();
52 let inputs = inputs(local_key, ty)?.into_iter().collect();
53 let outputs = outputs(local_key, ty)?.into_iter().collect();
54 Ok(interlayer::Node {
55 entity: interlayer::Entity {
56 name: p.entity.name,
57 ty: p
58 .entity
59 .ty
60 .split('|')
61 .map(|x| x.trim().to_owned())
62 .collect(),
63 args: p.entity.args,
64 },
65 res: p.res,
66 cloned: p.cloned,
67 inputs,
68 outputs,
69 is_dyn: false,
70 is_shared,
71 })
72}
73
74fn translate_conn(
75 p: presentation::Connection,

Callers 2

translate_graphFunction · 0.85
translate_configFunction · 0.85

Calls 2

inputsFunction · 0.50
outputsFunction · 0.50

Tested by

no test coverage detected