Skip to content

Commit

Permalink
fix conversion from Index class to usual vector
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Shyrma committed Mar 14, 2019
1 parent 8fa487b commit 3808d15
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 9 deletions.
28 changes: 19 additions & 9 deletions libnd4j/blas/cpu/NDArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5075,10 +5075,15 @@ Nd4jLong NDArray::getOffset(const Nd4jLong i) const {
for (int d = 0; d < idxSize; ++d) {

if (idx.at(d)->isAll()) {
indexes[3 * d] = 0; // first
indexes[3 * d + 1] = 0; // last
indexes[3 * d + 2] = 1; // stride
indexes[3 * d] = 0; // first
indexes[3 * d + 1] = 0; // last
indexes[3 * d + 2] = 1; // stride
}
else if (idx.at(d)->isPoint()) {
indexes[3 * d] = idx.at(d)->getIndices().at(0); // first
indexes[3 * d + 1] = indexes[3 * d] + 1; // last
indexes[3 * d + 2] = 1; // stride
}
else {
indexes[3 * d] = idx.at(d)->getIndices().at(0); // first
indexes[3 * d + 1] = idx.at(d)->getIndices().at(1); // last
Expand All @@ -5103,14 +5108,19 @@ Nd4jLong NDArray::getOffset(const Nd4jLong i) const {
for (const auto& item : idx) {

if (item->isAll()) {
indexes[3 * d] = 0; // first
indexes[3 * d + 1] = 0; // last
indexes[3 * d + 2] = 1; // stride
indexes[3 * d] = 0; // first
indexes[3 * d + 1] = 0; // last
indexes[3 * d + 2] = 1; // stride
}
else if (item->isPoint()) {
indexes[3 * d] = item->getIndices().at(0); // first
indexes[3 * d + 1] = indexes[3 * d] + 1; // last
indexes[3 * d + 2] = 1; // stride
}
else {
indexes[3 * d] = item->getIndices().at(0); // first
indexes[3 * d + 1] = item->getIndices().at(1); // last
indexes[3 * d + 2] = item->getIndices().at(2); // stride
indexes[3 * d] = item->getIndices().at(0); // first
indexes[3 * d + 1] = item->getIndices().at(1); // last
indexes[3 * d + 2] = item->getIndices().at(2); // stride
}
++d;
}
Expand Down
46 changes: 46 additions & 0 deletions sftp-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help

// sftp, ftp or ftps
"type": "sftp",

"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,

"host": "yurii-dev.northeurope.cloudapp.azure.com",
"user": "skymind",
//"password": "password",
//"port": "22",

"remote_path": "/home/skymind/main/github/deeplearning4j/",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",

//"extra_list_connections": 0,

"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
// "sftp_flags": ["-F", "/path/to/ssh_config"],
// "sftp_flags": ["-o", "ProxyCommand nc -X connect -x proxy.kinr.kiev.ua:3128 %h %p"],

//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}

0 comments on commit 3808d15

Please sign in to comment.