@@ -19,19 +19,6 @@ namespace deepx::mem
1919
2020 std::unordered_map<std::string, std::shared_ptr<TensorBase>> mem;
2121 int tempidx = 0 ;
22-
23- // template <typename T>
24- // static std::shared_ptr<void> type_erase(const std::shared_ptr<Tensor<T>> &ptr)
25- // {
26- // return std::static_pointer_cast<void>(ptr);
27- // }
28-
29- // template <typename T>
30- // static std::shared_ptr<Tensor<T>> type_restore(const std::shared_ptr<void> &ptr)
31- // {
32- // return std::static_pointer_cast<Tensor<T>>(ptr);
33- // }
34-
3522 public:
3623 Mem () = default ;
3724 ~Mem () = default ;
@@ -62,7 +49,7 @@ namespace deepx::mem
6249 {
6350 if (args.find (name) != args.end ())
6451 {
65- cerr << " Argument already exists: " << name << endl;
52+ cerr << " arg already exists: " << name << endl;
6653 }
6754 args[name] = value;
6855 }
@@ -72,7 +59,7 @@ namespace deepx::mem
7259 {
7360 if (args.find (name) == args.end ())
7461 {
75- cerr << " Argument not found: " << name << endl;
62+ cerr << " arg not found: " << name << endl;
7663 return T ();
7764 }
7865 return any_cast<T>(args.at (name));
@@ -83,7 +70,7 @@ namespace deepx::mem
8370 {
8471 if (args.find (name) != args.end ())
8572 {
86- cerr << " Vector already exists: " << name << endl;
73+ cerr << " vector already exists: " << name << endl;
8774 return ;
8875 }
8976 args[name] = value;
@@ -94,7 +81,7 @@ namespace deepx::mem
9481 {
9582 if (args.find (name) == args.end ())
9683 {
97- cerr << " Vector not found: " << name << endl;
84+ cerr << " vector not found: " << name << endl;
9885 return vector<T>();
9986 }
10087 auto v = any_cast<vector<T>>(args.at (name));
@@ -108,7 +95,7 @@ namespace deepx::mem
10895 {
10996 if (mem.find (name) != mem.end ())
11097 {
111- cerr << " Tensor already exists: " << name << endl;
98+ cerr << " tensor already exists: " << name << endl;
11299 return ;
113100 }
114101 auto ptr = std::make_shared<Tensor<T>>(std::move (tensor));
@@ -120,7 +107,7 @@ namespace deepx::mem
120107 {
121108 if (mem.find (name) != mem.end ())
122109 {
123- cerr << " Tensor already exists: " << name << endl;
110+ cerr << " tensor already exists: " << name << endl;
124111 return ;
125112 }
126113 auto ptr = std::make_shared<Tensor<T>>(tensor);
@@ -160,7 +147,7 @@ namespace deepx::mem
160147 {
161148 if (mem.find (name) == mem.end ())
162149 {
163- cerr << " Tensor not found: " << name << endl;
150+ cerr << " tensor not found: " << name << endl;
164151 continue ;
165152 }
166153 auto ptr = mem.at (name);
0 commit comments