Skip to content
Permalink
Browse files

Revert D13740752: [c10] plug caffe2 into jit

Differential Revision:
D13740752

Original commit changeset: 2d9383574d42

fbshipit-source-id: e9ff217a438720423340a10af7fa263b33f2ae24
  • Loading branch information...
zdevito authored and facebook-github-bot committed Jan 25, 2019
1 parent 0e6791b commit c42431bd7af862bc8704937e5f7a9b2126bb8d91
@@ -332,7 +332,7 @@ void RunOperator(
CAFFE_ENFORCE(
fn_wrap,
"Operator not registered with FunctionSchema constructor.",
name.toUnqualString());
name);
auto fn = fn_wrap->getSchema();
auto op = caffe2::FunctionSchemaOperatorRegistry()->Create(
name.toUnqualString(), fn, inputs, outputs);
@@ -1098,7 +1098,7 @@ C10_DECLARE_REGISTRY(FunctionSchemaRegistry, FunctionSchemaStorageBase);
C10_REGISTER_CLASS(FunctionSchemaOperatorRegistry, name, impl) \
struct FunctionSchemaStorageBase##name : public FunctionSchemaStorageBase { \
c10::FunctionSchema getSchema() override { \
return c10::FunctionSchema("caffe2::" #name, inputs, outputs); \
return c10::FunctionSchema(#name, inputs, outputs); \
} \
}; \
C10_REGISTER_CLASS( \

This file was deleted.

@@ -6,8 +6,6 @@
#include <torch/csrc/utils/variadic.h>

#include <ATen/core/function_schema.h>
#include <caffe2/core/operator.h>

#include <c10/util/Metaprogramming.h>
#include <c10/util/TypeList.h>

@@ -260,8 +258,6 @@ Operator createOperator(
});
}

Operator createOperatorFromC2(const std::string& name);

/// Registration class for new operators. Effectively calls
/// `torch::jit::registerOperator` for every supplied operator, but allows doing
/// so in the global scope when a `RegisterOperators` object is assigned to a
@@ -283,14 +279,6 @@ struct TORCH_API RegisterOperators {
op(name, std::forward<Implementation>(implementation));
}

/// Requires declaration of the FunctionSchema with
/// REGISTER_FUNCTION_SCHEMA_OPERATOR(name, ...)
static RegisterOperators&& Caffe2Operator(const std::string& name) {
auto r = RegisterOperators();
registerOperator(createOperatorFromC2(name));
return std::move(r);
}

/// Creates a new operator from a name and implementation function (function
/// pointer or function object/lambda) using `torch::jit::createOperator`, and
/// then registers the operator.
@@ -15,8 +15,6 @@
#include <torch/csrc/jit/script/jit_exception.h>
#include <ATen/core/thread_pool.h>

#include <caffe2/core/operator.h>

#include <exception>
#include <iostream>
#include <memory>

0 comments on commit c42431b

Please sign in to comment.
You can’t perform that action at this time.