MCPcopy Create free account
hub / github.com/pytorch/pytorch / render

Function render

caffe2/python/nomnigraph.py:110–130  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

108
109
110def render(s):
111 s = str(s)
112 cmd_exists = lambda x: any(
113 os.access(os.path.join(path, x), os.X_OK)
114 for path in os.getenv("PATH", "").split(os.pathsep)
115 )
116 if cmd_exists("graph-easy"):
117 p = Popen("graph-easy", stdin=PIPE)
118 try:
119 p.stdin.write(s.encode("utf-8"))
120 except IOError as e:
121 if e.errno == errno.EPIPE or e.errno == errno.EINVAL:
122 pass
123 else:
124 # Raise any other error.
125 raise
126
127 p.stdin.close()
128 p.wait()
129 else:
130 print(s)
131
132
133NeuralNetOperator = C.NeuralNetOperator

Callers 3

code.jsFile · 0.85
codegen_templateMethod · 0.85
codegen_templateMethod · 0.85

Calls 7

encodeMethod · 0.80
anyFunction · 0.50
joinMethod · 0.45
splitMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…