Home
last modified time | relevance | path

Searched refs:BaseRef (Results 1 – 25 of 349) sorted by relevance

12345678910>>...14

/third_party/mindspore/mindspore/core/base/
Dbase_ref.h32 class BaseRef; variable
37 using iterator = std::vector<BaseRef>::iterator;
38 using const_iterator = std::vector<BaseRef>::const_iterator;
39 using const_reverse_iterator = std::vector<BaseRef>::const_reverse_iterator;
53 using is_base_ref = std::is_base_of<BaseRef, remove_reference_t<T>>;
55 iterator ConstIteratorCast(std::vector<BaseRef> *v, const_iterator iter);
57 inline std::shared_ptr<VectorRef> MakeNode(const std::vector<BaseRef> &elements) { in MakeNode()
61 inline std::shared_ptr<VectorRef> MakeNode(std::initializer_list<BaseRef> elements) { in MakeNode()
81 std::vector<BaseRef> ret; in MakeNode()
88 class MS_CORE_API BaseRef : public Base {
[all …]
Dbase_ref.cc20 iterator ConstIteratorCast(std::vector<BaseRef> *v, const const_iterator iter) { in ConstIteratorCast()
24 BaseRef::BaseRef(const BaseRef &other) : Base(other), m_ptr(other.m_ptr) { in BaseRef() function in mindspore::BaseRef
30 bool BaseRef::operator==(const BaseRef &other) const { in operator ==()
49 if (m_ptr->isa<BaseRef>()) { in operator ==()
50 …return *std::static_pointer_cast<BaseRef>(m_ptr) == *std::static_pointer_cast<BaseRef>(other.m_ptr… in operator ==()
58 BaseRef &BaseRef::operator=(const BaseRef &other) { in operator =()
67 BaseRef &BaseRef::operator=(BaseRef &&other) { in operator =()
76 std::string BaseRef::ToString() const { in ToString()
83 uint32_t BaseRef::type() const { in type()
140 bool VectorRef::operator==(const BaseRef &other) const { in operator ==()
[all …]
/third_party/mindspore/mindspore/ccsrc/vm/
Dvmimpl.h36 using AnfNodePtrToBaseRefMap = std::unordered_map<AnfNodePtr, BaseRef>;
39 using FuncGraphPtrToBaseRefMap = std::unordered_map<FuncGraphPtr, BaseRef>;
80 const BaseRef operator[](const AnfNodePtr &node);
98 BaseRef operator()(const VectorRef &args);
121 Partial(const BaseRef &fn, const VectorRef &args, const VMPtr &vm);
122 BaseRef operator()(const VectorRef &nodes);
123 const BaseRef &fn() const { return fn_; } in fn()
131 BaseRef fn_;
145 BaseRef ExportPrimitive(const PrimitivePtr &) const { return kAnyValue; } in ExportPrimitive()
152 BaseRef ExportObj(const BaseRef &obj) const;
[all …]
Dvmimpl.cc44 explicit ReturnWrap(const BaseRef &r_value) : value(r_value) {} in ReturnWrap()
45 BaseRef value{BaseRef()};
55 const BaseRef VMFrame::operator[](const AnfNodePtr &node) { in operator []()
77 BaseRef Closure::operator()(const VectorRef &args) { in operator ()()
83 Partial::Partial(const BaseRef &fn, const VectorRef &args, const VMPtr &vm) : fn_(fn), args_(args),… in Partial()
85 BaseRef Partial::operator()(const VectorRef &nodes) { in operator ()()
132 std::vector<BaseRef> ret; in ExportSequence()
134 [&, this](const BaseRef &x) -> BaseRef { return Export(x); }); in ExportSequence()
152 BaseRef VM::ExportObj(const BaseRef &obj) const { return obj; } in ExportObj()
154 BaseRef VM::Export(const BaseRef &value) { in Export()
[all …]
Dvm.h87 StructSimuSwitch(const BaseRef &fn, const BaseRef &value);
92 BaseRef fn_;
93 BaseRef value_;
105 BaseRef Eval(const VectorRef &args);
122 BaseRef RunHook(const PrimitivePtr &prim, const VectorRef &arg);
125 BaseRef Ref(int64_t i);
126 void Push(const BaseRef &v);
133 void DoJmp(const BaseRef &jmp);
138 std::deque<BaseRef> insts_stack_;
Dvm.cc46 StructSimuSwitch::StructSimuSwitch(const BaseRef &fn, const BaseRef &value) : fn_(fn), value_(value… in StructSimuSwitch()
71 insts_stack_.emplace_back(BaseRef()); in FinalVM()
75 void FinalVM::Push(const BaseRef &v) { in Push()
85 insts_stack_[IntToSize(sp_ - i - 1)] = BaseRef(); in Pop()
103 BaseRef FinalVM::Ref(int64_t i) { in Ref()
143 void FinalVM::DoJmp(const BaseRef &jmp_orig) { in DoJmp()
146 BaseRef jmp = jmp_orig; in DoJmp()
151 InstPadStack(VectorRef(std::vector<BaseRef>{static_cast<int64_t>(args.size())})); in DoJmp()
167 BaseRef FinalVM::Eval(const VectorRef &args) { in Eval()
285 std::vector<BaseRef> outs(args.size() - 1); in InstRealPartial()
[all …]
/third_party/mindspore/tests/ut/cpp/utils/
Dbaseref_test.cc34 BaseRef a = static_cast<int64_t>(1); in TEST_F()
35 BaseRef b = 1.0; in TEST_F()
42 ASSERT_TRUE(isa<BaseRef>(a)); in TEST_F()
45 BaseRef c = static_cast<int64_t>(1); in TEST_F()
49 void func(const BaseRef& sexp) { in func()
53 BaseRef v = a[i]; in func()
62 BaseRef d = anf; in TEST_F()
78 BaseRef b; in TEST_F()
88 BaseRef c = std::make_shared<VectorRef>(a); in TEST_F()
89 BaseRef c1 = std::make_shared<VectorRef>(a); in TEST_F()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/
Dlamb_next_mv_with_decay_rule.h46 const BaseRef DefinePattern() const override = 0;
47 BaseRef DefineAnotherPattern() const override = 0;
74 const BaseRef DefinePattern() const override;
75 BaseRef DefineAnotherPattern() const override;
84 const BaseRef DefinePattern() const override;
85 BaseRef DefineAnotherPattern() const override;
94 const BaseRef DefinePattern() const override;
95 BaseRef DefineAnotherPattern() const override;
104 const BaseRef DefinePattern() const override;
105 BaseRef DefineAnotherPattern() const override;
Dadam_apply_one_with_decay_rule.h46 const BaseRef DefinePattern() const override = 0;
73 const BaseRef DefinePattern() const override;
82 const BaseRef DefinePattern() const override;
91 const BaseRef DefinePattern() const override;
100 const BaseRef DefinePattern() const override;
109 const BaseRef DefinePattern() const override;
118 const BaseRef DefinePattern() const override;
127 const BaseRef DefinePattern() const override;
136 const BaseRef DefinePattern() const override;
145 const BaseRef DefinePattern() const override;
[all …]
Dadam_apply_one_fusion.h47 const BaseRef DefinePattern() const override;
67 const BaseRef DefinePattern() const override;
76 const BaseRef DefinePattern() const override;
85 const BaseRef DefinePattern() const override;
94 const BaseRef DefinePattern() const override;
103 const BaseRef DefinePattern() const override;
112 const BaseRef DefinePattern() const override;
121 const BaseRef DefinePattern() const override;
130 const BaseRef DefinePattern() const override;
139 const BaseRef DefinePattern() const override;
Dlamb_next_mv_rule.h56 const BaseRef DefinePattern() const override = 0;
57 BaseRef DefineAnotherPattern() const override = 0;
95 const BaseRef DefinePattern() const override;
96 BaseRef DefineAnotherPattern() const override;
104 const BaseRef DefinePattern() const override;
105 BaseRef DefineAnotherPattern() const override;
113 const BaseRef DefinePattern() const override;
114 BaseRef DefineAnotherPattern() const override;
122 const BaseRef DefinePattern() const override;
123 BaseRef DefineAnotherPattern() const override;
Dclip_by_norm_no_div_square_sum_fusion.cc28 const BaseRef ClipByNormNoDivSquareSumFusion::DefinePattern() const { in DefinePattern()
53 BaseRef &input_gnode = (*equiv)[input_]; in Process()
54 BaseRef &constant_select_gnode = (*equiv)[constant_select_]; in Process()
55 BaseRef &constant_greater_gnode = (*equiv)[constant_greater_]; in Process()
56 BaseRef &constant_maximum_gnode = (*equiv)[constant_maximum_]; in Process()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/common/
Dpattern_engine.h48 using ConditionFunc = std::function<bool(const BaseRef &)>;
70 virtual bool matches(const BaseRef &) { return true; } in matches() argument
113 bool matches(const BaseRef &value) override { in matches()
135 bool matches(const BaseRef &value) override { in matches()
139 return std::all_of(seq.begin(), seq.end(), [this](const BaseRef &v) { in matches()
159 using Equiv = std::map<VarPtr, BaseRef>;
164 inline bool DefaultTypeEq(const BaseRef &x, const BaseRef &y) { return x.type() == y.type(); } in DefaultTypeEq()
171 EquivPtr Match(const BaseRef &pattern, const BaseRef &expr, const PrimitiveVarMap &primitive_vars,
178 bool ToVector(const BaseRef &pattern, const BaseRef &expr, VectorRef *const values_pattern,
182 static bool CNodeTypeEqual(const BaseRef &a, const BaseRef &b);
Dvisit.cc32 bool CheckIfNeedExpand(const std::vector<BaseRef> &list) { in CheckIfNeedExpand()
33 …return std::any_of(list.begin(), list.end(), [](const BaseRef &any) { return utils::isa<Seq>(any);… in CheckIfNeedExpand()
36 std::shared_ptr<VectorRef> ExpandList(const std::vector<BaseRef> &list) { in ExpandList()
49 static BaseRef GetVar(const BaseRef &x) { in GetVar()
61 bool Visitor::Visit(const VectorRef &v_any, VectorRef *const values_ref, BaseRef *const visit_out) … in Visit()
62 std::vector<BaseRef> out; in Visit()
73 bool Visitor::Visit(const BaseRef &any, VectorRef *const values_ref, BaseRef *const visit_out) cons… in Visit()
125 std::vector<BaseRef> after_cnode_fn; in Visit()
135 std::vector<BaseRef> &outs = after_cnode_fn; in Visit()
147 BaseRef any_fg; in Visit()
[all …]
Dpattern_engine.cc71 std::ostream &operator<<<VarPtr, BaseRef>(std::ostream &os, const Equiv &equiv) {
77 BaseRef x = equiv_item.second;
102 static BaseRef GetVar(const BaseRef &x) { in GetVar()
127 EquivPtr MatchOnVar(const BaseRef &pattern, const BaseRef &expr, EquivPtr equiv) { in MatchOnVar()
153 bool PatternEngine::ToVector(const BaseRef &pattern_ref, const BaseRef &expr_ref, VectorRef *const … in ToVector()
181 void UpdateEquivMap(const VectorRef &values_pattern, const BaseRef &expr_ref, const PrimitiveVarMap… in UpdateEquivMap()
234 …std::vector<BaseRef>(values_expr.begin() + svar_index, values_expr.begin() + svar_index + SizeToIn… in AlignSVar()
249 EquivPtr PatternEngine::Match(const BaseRef &pattern, const BaseRef &expr, const PrimitiveVarMap &p… in Match()
253 BaseRef pattern_ref = GetVar(pattern); in Match()
255 BaseRef expr_ref = expr; in Match()
[all …]
Dvisit.h38 bool Visit(const VectorRef &e, VectorRef *const values_ref, BaseRef *out) const;
39 bool Visit(const BaseRef &e, VectorRef *const values_ref, BaseRef *out) const;
45 std::shared_ptr<VectorRef> ExpandList(const std::vector<BaseRef> &list);
46 bool CheckIfNeedExpand(const std::vector<BaseRef> &list);
/third_party/mindspore/mindspore/lite/tools/converter/parser/
Dtf_bidirection_gru_cf_fusion.h38 const BaseRef DefinePattern() const override;
42 BaseRef DefineGruCellPattern(const BaseRef &in_ta_read, const BaseRef &switch3_true,
45 const BaseRef DefineBidirectionRnnPattern(const BaseRef &input, const std::vector<VarPtr> &vars,
/third_party/mindspore/mindspore/lite/tools/optimizer/fusion/
Dtflite_rel_pos_multi_head_attention_fusion.h46 …const VectorRef DefineProcessInputPattern(const BaseRef &input, const BaseRef &weight, const BaseR…
49 …const VectorRef DefineProcessOutputPattern(const BaseRef &input, const BaseRef &weight, const Base…
56 const VectorRef DefineRelativeShiftPattern(const BaseRef &input) const;
/third_party/mindspore/mindspore/ccsrc/pybind_api/ir/
Dbase_ref_py.h30 class PyObjectRef : public BaseRef {
32 explicit PyObjectRef(const py::object &py_object) : BaseRef(), object_(py_object) {} in PyObjectRef()
33 explicit PyObjectRef(const py::tuple &tuple_obj) : BaseRef(), object_(tuple_obj) {} in PyObjectRef()
38 MS_DECLARE_PARENT(PyObjectRef, BaseRef) in MS_DECLARE_PARENT() argument
42 bool operator==(const BaseRef &other) const override;
/third_party/mindspore/mindspore/ccsrc/cxx_api/model/acl/acl_vm/
Dms_tensor_ref.h26 class MSTensorRef : public BaseRef {
28 MS_DECLARE_PARENT(MSTensorRef, BaseRef);
31 static std::vector<MSTensor> Convert(const BaseRef &args);
41 bool operator==(const BaseRef &other) const override;
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/mindir/
Doptimizer_unify_output.h28 const BaseRef DefinePattern() const override;
36 const BaseRef DefinePattern() const override;
45 const BaseRef DefinePattern() const override;
53 const BaseRef DefinePattern() const override;
Ddropout_unify_mindir.h31 const BaseRef DefinePattern() const override;
42 const BaseRef DefinePattern() const override;
50 const BaseRef DefinePattern() const override;
59 const BaseRef DefinePattern() const override;
Dsparse_softmax_cross_entropy_with_logits_unify_mindir.h32 const BaseRef DefinePattern() const override;
41 const BaseRef DefinePattern() const override;
50 const BaseRef DefinePattern() const override;
68 const BaseRef DefinePattern() const override;
/third_party/mindspore/tests/ut/cpp/pre_activate/common/
Dpattern_engine_test.cc29 using PatternListType = std::initializer_list<BaseRef>;
31 bool Equal(const BaseRef &a, const BaseRef &b) { return a == b; } in Equal()
58 auto Pos = static_cast<bool (*)(const BaseRef &)>([](const BaseRef &any) -> bool { in TEST_F()
185 …static_cast<bool (*)(const BaseRef &)>([](const BaseRef &any) -> bool { return utils::isa<float>(a… in TEST_F()
186 auto neg = static_cast<bool (*)(const BaseRef &)>([](const BaseRef &any) -> bool { in TEST_F()
/third_party/mindspore/mindspore/lite/tools/optimizer/common/
Dgllo_utils.h69 bool IsParamNode(const BaseRef &n);
71 bool IsParamOrValueNodeWithData(const BaseRef &n);
73 bool IsParallelSplitConvNode(const BaseRef &n);
75 bool IsConvNode(const BaseRef &n);
77 bool IsOpType(const BaseRef &n, const PrimitivePtr &prim);
124 inline bool IsSpecifiedNode(const BaseRef &n) { in IsSpecifiedNode()

12345678910>>...14