forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UndefinedTensorImpl.cpp
40 lines (30 loc) · 1.08 KB
/
UndefinedTensorImpl.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "ATen/core/UndefinedTensorImpl.h"
#include "c10/util/Exception.h"
namespace at {
// should this use the globalContext? Can it get a context passed in somehow?
UndefinedTensorImpl::UndefinedTensorImpl()
: TensorImpl(UndefinedTensorId(), caffe2::TypeMeta(), nullptr, /* is variable */ false) {
}
IntList UndefinedTensorImpl::sizes() const {
AT_ERROR("sizes() called on undefined Tensor");
}
int64_t UndefinedTensorImpl::size(int64_t d) const {
AT_ERROR("size(dim) called on an undefined Tensor");
}
int64_t UndefinedTensorImpl::stride(int64_t d) const {
AT_ERROR("stride(dim) called on an undefined Tensor");
}
int64_t UndefinedTensorImpl::dim() const {
AT_ERROR("dim() called on undefined Tensor");
}
const Storage& UndefinedTensorImpl::storage() const {
AT_ERROR("storage() called on undefined Tensor");
}
int64_t UndefinedTensorImpl::storage_offset() const {
AT_ERROR("storage_offset() called on an undefined Tensor");
}
IntList UndefinedTensorImpl::strides() const {
AT_ERROR("strides() called on undefined Tensor");
}
UndefinedTensorImpl UndefinedTensorImpl::_singleton;
}