MCPcopy Create free account
hub / github.com/BVLC/caffe / model_checks_out

Function model_checks_out

scripts/download_model_binary.py:63–65  ·  view source on GitHub ↗
(filename=model_filename, sha1=frontmatter['sha1'])

Source from the content-addressed store, hash-verified

61
62 # Closure-d function for checking SHA1.
63 def model_checks_out(filename=model_filename, sha1=frontmatter['sha1']):
64 with open(filename, 'rb') as f:
65 return hashlib.sha1(f.read()).hexdigest() == sha1
66
67 # Check if model exists.
68 if os.path.exists(model_filename) and model_checks_out():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected