Caffe2 - C++ API
A deep learning, cross platform ML framework
UndefinedTensorImpl.h
1 #pragma once
2 
3 #include <c10/core/TensorImpl.h>
4 
5 namespace c10 {
6 
7 struct C10_API UndefinedTensorImpl final : public TensorImpl {
8  public:
9  // Without this, we get:
10  // error: identifier "at::UndefinedTensorImpl::_singleton" is undefined in device code
11  // (ostensibly because the constexpr tricks MSVC into trying to compile this
12  // function for device as well).
13 #ifdef _WIN32
14  static inline TensorImpl * singleton() {
15 #else
16  static constexpr inline TensorImpl * singleton() {
17 #endif
18  return &_singleton;
19  }
20  IntArrayRef sizes() const override;
21  IntArrayRef strides() const override;
22  int64_t size(int64_t d) const override;
23  int64_t stride(int64_t d) const override;
24  int64_t dim() const override;
25  bool has_storage() const override;
26  const Storage& storage() const override;
27  int64_t storage_offset() const override;
28 private:
30  static UndefinedTensorImpl _singleton;
31 public:
32  friend struct UndefinedType;
33 };
34 
35 } // namespace c10
The low-level representation of a tensor, which contains a pointer to a storage (which contains the a...
Definition: TensorImpl.h:211
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...
Definition: alias_info.h:7