diff options
author | James Reed <jamesreed@fb.com> | 2018-06-19 12:46:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 12:46:23 -0700 |
commit | 5ca4f5b43b63882794951aec8fcb81a7595414d0 (patch) | |
tree | 6a9c2d256ab402c7d6fadd8d81ebbdafdf195362 /torch | |
parent | a2dd7070318373aaaf9603a7ac2562742efaa044 (diff) | |
download | pytorch-5ca4f5b43b63882794951aec8fcb81a7595414d0.tar.gz pytorch-5ca4f5b43b63882794951aec8fcb81a7595414d0.tar.bz2 pytorch-5ca4f5b43b63882794951aec8fcb81a7595414d0.zip |
[JIT] Remove dead functions (#8658)
Diffstat (limited to 'torch')
-rw-r--r-- | torch/csrc/jit/script/compiler.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/torch/csrc/jit/script/compiler.cpp b/torch/csrc/jit/script/compiler.cpp index 851ea932fe..648e8395d8 100644 --- a/torch/csrc/jit/script/compiler.cpp +++ b/torch/csrc/jit/script/compiler.cpp @@ -241,28 +241,6 @@ std::shared_ptr<SugaredValue> packOutputs(Graph& g, at::ArrayRef<Value*> values) return std::make_shared<SimpleValue>(g.insertNode(g.createTuple(values))->output()); } -at::Tensor getConstantValue(const SourceRange& loc, Value* v) { - if(v->node()->kind() == prim::Constant) { - auto t = v->node()->t(attr::value); - if(t.ndimension() > 0) { - throw ErrorReport(loc) << "attributes must be scalars or lists of scalars"; - } - return t; - } - throw ErrorReport(loc) << "attributes must be constant expressions"; -} - -at::Tensor getAttributeValue(const NamedValue& nv) { - auto v = nv.value; - if(v->node()->kind() == prim::TupleConstruct) { - auto ts = fmap(v->node()->inputs(), [&](Value* input) { - return getConstantValue(nv.loc, input); - }); - return at::stack(ts); - } - return getConstantValue(nv.loc, v); -} - Value* createConstant(Graph& g, const SourceRange& loc, const at::Tensor& val) { auto n = g.createConstant(val); n->setSourceLocation(std::make_shared<SourceRange>(loc)); |