MCPcopy Create free account
hub / github.com/tensorflow/tfjs / open_file

Function open_file

tfjs-converter/python/tensorflowjs/resource_loader.py:24–37  ·  view source on GitHub ↗

Opens the file at given path, where path is relative to tensorflowjs/. Args: path: a string resource path relative to tensorflowjs/. Returns: An open file of that resource. Raises: IOError: If the path is not found, or the resource can't be opened.

(path)

Source from the content-addressed store, hash-verified

22
23
24def open_file(path):
25 """Opens the file at given path, where path is relative to tensorflowjs/.
26
27 Args:
28 path: a string resource path relative to tensorflowjs/.
29
30 Returns:
31 An open file of that resource.
32
33 Raises:
34 IOError: If the path is not found, or the resource can't be opened.
35 """
36 path = os.path.join(os.path.dirname(os.path.abspath(__file__)), path)
37 return open(path)
38
39
40def list_dir(path):

Callers

nothing calls this directly

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…