Skip to content

Commit 6eef9c2

Browse files
authored
Merge pull request #118 from iotamudelta/master
Merge from upstream
2 parents 5e2bc5a + 77f497c commit 6eef9c2

File tree

97 files changed

+3042
-4220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3042
-4220
lines changed

.jenkins/caffe2/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ if [[ -z "$INTEGRATED" ]]; then
217217
218218
else
219219
220-
sudo FULL_CAFFE2=1 python setup.py install
220+
FULL_CAFFE2=1 python setup.py install --user
221221
# TODO: I'm not sure why this is necessary
222222
cp -r torch/lib/tmp_install $INSTALL_PREFIX
223223

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,6 @@ include_directories(BEFORE ${PROJECT_BINARY_DIR})
288288

289289
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/aten/src/)
290290

291-
# ---[ Old caffe protobuf
292-
if(BUILD_CAFFE2)
293-
add_subdirectory(caffe/proto)
294-
endif()
295-
296291
# ---[ Main build
297292
add_subdirectory(caffe2)
298293

aten/src/ATen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ IF(USE_CUDA AND NOT USE_ROCM)
251251
ENDIF(USE_MAGMA)
252252
IF ($ENV{ATEN_STATIC_CUDA})
253253
list(APPEND ATen_CUDA_DEPENDENCY_LIBS "${CUDA_TOOLKIT_ROOT_DIR}/lib64/libculibos.a")
254+
list(APPEND ATen_CUDA_DEPENDENCY_LIBS "${CUDA_TOOLKIT_ROOT_DIR}/lib64/libcudart_static.a")
254255
ENDIF($ENV{ATEN_STATIC_CUDA})
255256
ENDIF()
256257

aten/src/ATen/CPUApplyUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ inline void _setup_arrays(Tensor& tensor, Arg* iter) {
5757
for (int64_t i = 0; i < max_dim; i++) {
5858
int64_t size = tensor.size(i);
5959
int64_t stride = tensor.stride(i);
60-
while (i + 1 < max_dim &&
60+
while (tensor.stride(i) > 0 && i + 1 < max_dim &&
6161
(tensor.size(i + 1) == 1 ||
6262
tensor.stride(i) == tensor.size(i + 1) * tensor.stride(i + 1))) {
6363
size = size * tensor.size(i + 1);

aten/src/ATen/Declarations.cwrap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
- THStorage* source
5959
- long storage_offset
6060
- IntListSize size
61-
- arg: IntListStride stride
61+
- arg: IntList stride
6262
default: {}
6363
]]
6464
[[
@@ -3408,13 +3408,13 @@
34083408
- cname: newWithSize
34093409
arguments:
34103410
- IntListSize size
3411-
- arg: IntListStride stride
3411+
- IntList stride
34123412
- cname: newWithStorage
34133413
arguments:
34143414
- THStorage* storage
34153415
- int64_t storageOffset
34163416
- IntListSize size
3417-
- arg: IntListStride stride
3417+
- arg: IntList stride
34183418
default: {}
34193419
]]
34203420

aten/src/ATen/Device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ Device::Device(const std::string& device_string) : Device(Type::CPU) {
7575
}
7676
}
7777

78-
} // namespace at
79-
8078
std::ostream& operator<<(std::ostream& stream, const at::Device& device) {
8179
stream << device.type();
8280
if (device.has_index()) {
8381
stream << ":" << device.index();
8482
}
8583
return stream;
8684
}
85+
86+
} // namespace at

aten/src/ATen/Device.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ struct Device {
111111
DeviceType type_;
112112
int32_t index_ = -1;
113113
};
114-
} // namespace at
115114

116115
AT_API std::ostream& operator<<(std::ostream& stream, const at::Device& device);
117116

117+
} // namespace at
118+
119+
118120
namespace std {
119121
template<> struct hash<at::Device>
120122
{

aten/src/ATen/Layout.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ inline Layout layout_from_backend(Backend backend) {
2020
return Layout::Strided;
2121
}
2222
}
23-
} // namespace at
2423

2524
inline std::ostream& operator<<(std::ostream& stream, at::Layout layout) {
2625
switch (layout) {
@@ -32,3 +31,5 @@ inline std::ostream& operator<<(std::ostream& stream, at::Layout layout) {
3231
AT_ERROR("Unknown layout");
3332
}
3433
}
34+
35+
} // namespace at

aten/src/ATen/THSizeStrideCompat.h

Lines changed: 0 additions & 32 deletions
This file was deleted.

aten/src/ATen/TensorGeometry.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
namespace at {
66

77
bool TensorGeometry::is_contiguous() const {
8+
if (numel_ == 0) {
9+
return true;
10+
}
811
int64_t dim = sizes_.size();
912
int64_t expected_stride = 1;
1013
for (int64_t i = dim - 1; i >= 0; i--) {

0 commit comments

Comments
 (0)