From: Raghavan Raman Date: Mon, 30 Aug 2021 11:38:00 +0000 (-0700) Subject: [nnc] Fixed warning due to implicit parameter conversion (#64117) X-Git-Tag: accepted/tizen/8.0/unified/20231005.095509~606 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a836d83957a526a69b3d3de7094e005aa988eb51;p=platform%2Fupstream%2Fpytorch.git [nnc] Fixed warning due to implicit parameter conversion (#64117) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/64117 Test Plan: Imported from OSS Reviewed By: ZolotukhinM Differential Revision: D30616945 Pulled By: navahgar fbshipit-source-id: eaf69232ac4a684ab5f97a54a514971655f86ef3 --- diff --git a/torch/csrc/jit/tensorexpr/expr.h b/torch/csrc/jit/tensorexpr/expr.h index fbbea12..4947bfd 100644 --- a/torch/csrc/jit/tensorexpr/expr.h +++ b/torch/csrc/jit/tensorexpr/expr.h @@ -319,11 +319,16 @@ class TORCH_API BufHandle : public ExprHandle { // object. For example: VarHandle x('x'); ExprHandle x2 = x; class TORCH_API VarHandle : public ExprHandle { public: + // Creates an empty VarHandle whose base Var is set to nullptr. VarHandle() : ExprHandle() {} + explicit VarHandle(Dtype dtype) : ExprHandle(Var::make(dtype)) {} + VarHandle(const std::string& name_hint, Dtype dtype) : ExprHandle(Var::make(name_hint, dtype)) {} + explicit VarHandle(VarPtr node) : ExprHandle(node) {} + VarPtr node() const { return static_to(ExprHandle::node()); }