File: SymIntNodeImpl.h

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (93 lines) | stat: -rw-r--r-- 2,339 bytes parent folder | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once

#include <c10/core/SymFloatNodeImpl.h>
#include <c10/macros/Macros.h>
#include <c10/util/Exception.h>
#include <c10/util/intrusive_ptr.h>
#include <memory>
#include <mutex>
#include <vector>

namespace c10 {

class SymInt;
class SymIntNodeImpl;

class C10_API SymIntNodeImpl : public c10::intrusive_ptr_target {
 public:
  c10::SymInt toSymInt();
  virtual ~SymIntNodeImpl(){};

  template <typename T>
  c10::intrusive_ptr<T> dyn_cast() const {
    return c10::intrusive_ptr<T>::reclaim_copy(dynamic_cast<T*>(this));
  }

  // these could be pure virtual when we implement LTC versions
  virtual SymIntNode add(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode sub(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode mul(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymFloatNode truediv(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode floordiv(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode mod(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode eq(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode ne(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode gt(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode lt(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode le(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode ge(const SymIntNode& other) {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode ceil() {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymIntNode clone() {
    TORCH_CHECK(false, "NYI");
  };
  virtual SymFloatNode sym_float() {
    TORCH_CHECK(false, "NYI");
  }
  virtual SymIntNode wrap(int64_t num) {
    TORCH_CHECK(false, "NYI");
  };
  virtual int64_t guard_int(const char* file, int64_t line) {
    TORCH_CHECK(false, "NYI");
  };
  virtual int64_t int_() {
    TORCH_CHECK(false, "NYI");
  };
  virtual bool bool_() {
    TORCH_CHECK(false, "NYI");
  };
  virtual std::string str() {
    TORCH_CHECK(false, "NYI");
  };
  std::ostream& operator<<(std::ostream& os) {
    os << str();
    return os;
  };
};

} // namespace c10