MCPcopy Create free account
hub / github.com/alibaba/euler / initialize_graph

Function initialize_graph

tf_euler/python/euler_ops/base.py:37–60  ·  view source on GitHub ↗

Initialize the Euler graph driver used in Tensorflow. Args: config: str or dict of Euler graph driver configuration. Return: A boolean indicate whether the graph driver is initialized successfully. Raises: TypeError: if config is neither str nor dict.

(config)

Source from the content-addressed store, hash-verified

35
36
37def initialize_graph(config):
38 """
39 Initialize the Euler graph driver used in Tensorflow.
40
41 Args:
42 config: str or dict of Euler graph driver configuration.
43
44 Return:
45 A boolean indicate whether the graph driver is initialized successfully.
46
47 Raises:
48 TypeError: if config is neither str nor dict.
49 """
50 if isinstance(config, dict):
51 config = ';'.join(
52 '{}={}'.format(key, value) for key, value in config.items())
53 if not isinstance(config, str):
54 raise TypeError('Expect str or dict for graph config, '
55 'got {}.'.format(type(config).__name__))
56
57 if not isinstance(config, bytes):
58 config = config.encode()
59
60 return _LIB.InitQueryProxy(config)
61
62
63def initialize_embedded_graph(data_dir, sampler_type='all', data_type='all'):

Callers 2

initialize_shared_graphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected