Skip to content

Instantly share code, notes, and snippets.

@dadeba
Created August 28, 2018 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dadeba/2f8b4b49a72c1a2762f975811cbba449 to your computer and use it in GitHub Desktop.
Save dadeba/2f8b4b49a72c1a2762f975811cbba449 to your computer and use it in GitHub Desktop.
+ def config_sync(self, size, direc):
+ with open(self.class_path + '/sync_size', mode='w') as f:
+ f.write(str(size))
+ with open(self.class_path + '/sync_direction', mode='w') as f:
+ f.write(str(direc))
+
+ def sync_for_cpu(self):
+ with open(self.class_path + '/sync_for_cpu', mode='w') as f:
+ f.write(str(1))
+
+ def sync_for_device(self):
+ with open(self.class_path + '/sync_for_device', mode='w') as f:
+ f.write(str(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment