33#include " torch/csrc/jit/frontend/resolver.h"
44
55namespace torch {
6- namespace jit {
7- namespace script {
8- struct RedisResolver : public Resolver {
9-
10- std::shared_ptr<SugaredValue> resolveValue (const std::string& name, Function& m, const SourceRange& loc) override {
11- if (strcasecmp (name.c_str (), " torch" ) == 0 ) {
12- return std::make_shared<BuiltinModule>(" aten" );
13- }
14- else if (strcasecmp (name.c_str (), " redis" ) == 0 ) {
15- return std::make_shared<BuiltinModule>(" redis" );
16- }
17- return nullptr ;
18- }
6+ namespace jit {
7+ namespace script {
8+ struct RedisResolver : public Resolver {
199
20- TypePtr resolveType (const std::string& name, const SourceRange& loc) override {
21- return nullptr ;
22- }
23-
24- };
25- inline std::shared_ptr<RedisResolver> redisResolver () {
26- return std::make_shared<RedisResolver>();
27- }
10+ std::shared_ptr<SugaredValue> resolveValue (const std::string &name, Function &m,
11+ const SourceRange &loc) override {
12+ if (strcasecmp (name.c_str (), " torch" ) == 0 ) {
13+ return std::make_shared<BuiltinModule>(" aten" );
14+ } else if (strcasecmp (name.c_str (), " redis" ) == 0 ) {
15+ return std::make_shared<BuiltinModule>(" redis" );
2816 }
17+ return nullptr ;
2918 }
30- }
3119
20+ TypePtr resolveType (const std::string &name, const SourceRange &loc) override {
21+ return nullptr ;
22+ }
23+ };
24+ inline std::shared_ptr<RedisResolver> redisResolver () { return std::make_shared<RedisResolver>(); }
25+ } // namespace script
26+ } // namespace jit
27+ } // namespace torch
3228
3329// c10::intrusive_ptr<RedisValue> redisExecute(std::string fn_name, std::vector<std::string> args );
3430
35- torch::IValue redisExecute (std::string fn_name, std::vector<std::string> args );
31+ torch::IValue redisExecute (std::string fn_name, std::vector<std::string> args);
3632torch::List<torch::IValue> asList (torch::IValue);
3733
38- static auto registry = torch::RegisterOperators(" redis::execute" , &redisExecute).op(" redis::asList" , &asList);
34+ static auto registry =
35+ torch::RegisterOperators (" redis::execute" , &redisExecute).op(" redis::asList" , &asList);
3936// registry = torch::RegisterOperators("torch::asList", &asList);
0 commit comments