You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/01 16:48:32 UTC
[GitHub] larroy commented on a change in pull request #11636: [MXNET-769]
set MXNET_DATA_DIR as base for downloaded models through base.data_dir()
larroy commented on a change in pull request #11636: [MXNET-769] set MXNET_DATA_DIR as base for downloaded models through base.data_dir()
URL: https://github.com/apache/incubator-mxnet/pull/11636#discussion_r206953244
##########
File path: python/mxnet/base.py
##########
@@ -59,6 +59,26 @@
py_str = lambda x: x
+def data_dir_default():
+ """
+
+ :return: default data directory depending on the platform and environment variables
+ """
+ system = platform.system()
+ if system == 'Windows':
+ return os.path.join(os.environ.get('APPDATA'), 'mxnet')
+ else:
+ return os.path.join(os.path.expanduser("~"), '.mxnet')
+
+
+def data_dir():
+ """
+
+ :return: data directory in the filesystem for storage, for example when downloading models
+ """
+ return os.getenv('MXNET_DATA_DIR', data_dir_default())
Review comment:
What help do we need?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services