[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
This commit is contained in:
Raghavan Raman 2021-08-30 04:38:00 -07:00 committed by Facebook GitHub Bot
parent d3bcba5f85
commit a836d83957

View File

@ -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<Var>(ExprHandle::node());
}