Merge pull request !21253 from hewei/core_user_apitags/v1.5.0-rc1
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace abstract { | |||
| class AbstractFuncAtom : public AbstractFunction { | |||
| class MS_CORE_API AbstractFuncAtom : public AbstractFunction { | |||
| public: | |||
| AbstractFuncAtom() = default; | |||
| ~AbstractFuncAtom() override = default; | |||
| @@ -42,7 +42,7 @@ class AbstractFuncAtom : public AbstractFunction { | |||
| std::size_t hash() const override { return tid(); } | |||
| }; | |||
| class AbstractFuncUnion : public AbstractFunction { | |||
| class MS_CORE_API AbstractFuncUnion : public AbstractFunction { | |||
| public: | |||
| explicit AbstractFuncUnion(const AbstractFuncAtomPtrList &func_list); | |||
| AbstractFuncUnion(const AbstractFunctionPtr &first, const AbstractFunctionPtr &second); | |||
| @@ -63,7 +63,7 @@ class AbstractFuncUnion : public AbstractFunction { | |||
| AbstractFuncAtomPtrList func_list_; | |||
| }; | |||
| class PrimitiveAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API PrimitiveAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| // Represents a Primitive. | |||
| // prim: The primitive | |||
| @@ -96,7 +96,7 @@ class PrimitiveAbstractClosure : public AbstractFuncAtom { | |||
| }; | |||
| using PrimitiveAbstractClosurePtr = std::shared_ptr<PrimitiveAbstractClosure>; | |||
| class FuncGraphAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API FuncGraphAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| // Represents a Graph in a certain Context. | |||
| // context: The context, or Context.empty() | |||
| @@ -140,7 +140,7 @@ class FuncGraphAbstractClosure : public AbstractFuncAtom { | |||
| }; | |||
| using FuncGraphAbstractClosurePtr = std::shared_ptr<FuncGraphAbstractClosure>; | |||
| class MetaFuncGraphAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API MetaFuncGraphAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| explicit MetaFuncGraphAbstractClosure(const MetaFuncGraphPtr &meta_func_graph, | |||
| const AnfNodePtr &tracking_id = nullptr, const ScopePtr &scope = kDefaultScope) | |||
| @@ -173,7 +173,7 @@ class MetaFuncGraphAbstractClosure : public AbstractFuncAtom { | |||
| }; | |||
| using MetaFuncGraphAbstractClosurePtr = std::shared_ptr<MetaFuncGraphAbstractClosure>; | |||
| class PartialAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API PartialAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| // Represents a partial application. | |||
| // args_spec_list: The first few arguments of that function | |||
| @@ -204,7 +204,7 @@ class PartialAbstractClosure : public AbstractFuncAtom { | |||
| }; | |||
| using PartialAbstractClosurePtr = std::shared_ptr<PartialAbstractClosure>; | |||
| class JTransformedAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API JTransformedAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| // Represents a Function transformed through the application of J. | |||
| explicit JTransformedAbstractClosure(const AbstractFuncAtomPtr &fn) : fn_(fn) {} | |||
| @@ -222,7 +222,7 @@ class JTransformedAbstractClosure : public AbstractFuncAtom { | |||
| AbstractFuncAtomPtr fn_; | |||
| }; | |||
| class VirtualAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API VirtualAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| // Represents some function with an explicitly fixed type signature. | |||
| // args_spec_list: The arguments as abstract value given to the function | |||
| @@ -251,7 +251,7 @@ class VirtualAbstractClosure : public AbstractFuncAtom { | |||
| }; | |||
| using VirtualAbstractClosurePtr = std::shared_ptr<VirtualAbstractClosure>; | |||
| class TypedPrimitiveAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API TypedPrimitiveAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| // Represents a Primitive with an explicitly fixed type signature. | |||
| // args_spec_list: The arguments as abstract value given to the Primitive | |||
| @@ -280,7 +280,7 @@ class TypedPrimitiveAbstractClosure : public AbstractFuncAtom { | |||
| }; | |||
| // Represents a function that can't be called. | |||
| class DummyAbstractClosure : public AbstractFuncAtom { | |||
| class MS_CORE_API DummyAbstractClosure : public AbstractFuncAtom { | |||
| public: | |||
| DummyAbstractClosure() = default; | |||
| ~DummyAbstractClosure() override = default; | |||
| @@ -292,14 +292,14 @@ class DummyAbstractClosure : public AbstractFuncAtom { | |||
| std::string ToString() const override { return "DummyAbstractClosure()"; } | |||
| }; | |||
| struct AbstractFunctionHasher { | |||
| struct MS_CORE_API AbstractFunctionHasher { | |||
| std::size_t operator()(const AbstractFunctionPtr &t) const { | |||
| std::size_t hash = t->hash(); | |||
| return hash; | |||
| } | |||
| }; | |||
| struct AbstractFunctionEqual { | |||
| struct MS_CORE_API AbstractFunctionEqual { | |||
| bool operator()(const AbstractFunctionPtr &lhs, const AbstractFunctionPtr &rhs) const { return *lhs == *rhs; } | |||
| }; | |||
| } // namespace abstract | |||
| @@ -43,7 +43,7 @@ using AbstractBasePtrList = std::vector<AbstractBasePtr>; | |||
| // The base class for abstract value. The abstract value is used in evaluating | |||
| // to express the type, shape, and value of the real value. | |||
| class AbstractBase : public Base { | |||
| class MS_CORE_API AbstractBase : public Base { | |||
| public: | |||
| using TraceNodeProvider = std::function<void(AnfNodePtr *node)>; | |||
| @@ -101,7 +101,7 @@ class AbstractBase : public Base { | |||
| std::string value_desc_; // store initial value description for error report | |||
| }; | |||
| class AbstractScalar : public AbstractBase { | |||
| class MS_CORE_API AbstractScalar : public AbstractBase { | |||
| public: | |||
| AbstractScalar() : AbstractBase(kAnyValue, kAnyType) {} | |||
| explicit AbstractScalar(const ValuePtr &value, const TypePtr &type) : AbstractBase(value, type) {} | |||
| @@ -127,7 +127,7 @@ class AbstractScalar : public AbstractBase { | |||
| }; | |||
| using AbstractScalarPtr = std::shared_ptr<AbstractScalar>; | |||
| class AbstractType : public AbstractBase { | |||
| class MS_CORE_API AbstractType : public AbstractBase { | |||
| public: | |||
| explicit AbstractType(const TypePtr &type) : AbstractBase(type, kTypeType) { | |||
| if (type == nullptr) { | |||
| @@ -146,7 +146,7 @@ class AbstractType : public AbstractBase { | |||
| }; | |||
| using AbstractTypePtr = std::shared_ptr<AbstractType>; | |||
| class AbstractError : public AbstractBase { | |||
| class MS_CORE_API AbstractError : public AbstractBase { | |||
| public: | |||
| explicit AbstractError(const StringImmPtr &err, const AnfNodePtr &node) : AbstractBase(err), node_(node) { | |||
| if (err == nullptr || node == nullptr) { | |||
| @@ -181,7 +181,7 @@ class AbstractFuncAtom; | |||
| using AbstractFuncAtomPtr = std::shared_ptr<AbstractFuncAtom>; | |||
| using AbstractFuncAtomPtrList = std::vector<AbstractFuncAtomPtr>; | |||
| class AbstractFunction : public AbstractBase { | |||
| class MS_CORE_API AbstractFunction : public AbstractBase { | |||
| public: | |||
| AbstractFunction() = default; | |||
| ~AbstractFunction() override = default; | |||
| @@ -215,7 +215,7 @@ class AbstractFunction : public AbstractBase { | |||
| using AbstractFunctionPtrList = std::vector<AbstractFunctionPtr>; | |||
| // Represents a key-value pair used in function's parameters. | |||
| class AbstractKeywordArg : public AbstractBase { | |||
| class MS_CORE_API AbstractKeywordArg : public AbstractBase { | |||
| public: | |||
| AbstractKeywordArg(const std::string &key, const AbstractBasePtr &argument) : arg_name_(key), arg_value_(argument) {} | |||
| ~AbstractKeywordArg() override = default; | |||
| @@ -242,7 +242,7 @@ class AbstractKeywordArg : public AbstractBase { | |||
| }; | |||
| using AbstractKeywordArgPtr = std::shared_ptr<AbstractKeywordArg>; | |||
| class AbstractUndetermined : public AbstractBase { | |||
| class MS_CORE_API AbstractUndetermined : public AbstractBase { | |||
| public: | |||
| // shape and type are all unknown | |||
| AbstractUndetermined() : AbstractBase(kAnyValue) {} | |||
| @@ -291,7 +291,7 @@ class AbstractUndetermined : public AbstractBase { | |||
| AbstractBasePtr element_; | |||
| }; | |||
| class AbstractTensor : public AbstractUndetermined { | |||
| class MS_CORE_API AbstractTensor : public AbstractUndetermined { | |||
| public: | |||
| // only element_ and value, shape track are valid member, type track are unknown. | |||
| explicit AbstractTensor(const AbstractBasePtr &element, const BaseShapePtr &shape = std::make_shared<Shape>()) | |||
| @@ -340,7 +340,7 @@ class AbstractTensor : public AbstractUndetermined { | |||
| using AbstractTensorPtr = std::shared_ptr<AbstractTensor>; | |||
| using AbstractTensorPtrList = std::vector<AbstractTensorPtr>; | |||
| class AbstractSequeue : public AbstractBase { | |||
| class MS_CORE_API AbstractSequeue : public AbstractBase { | |||
| public: | |||
| explicit AbstractSequeue(const AbstractBasePtrList &elements) : elements_(elements) {} | |||
| ~AbstractSequeue() override = default; | |||
| @@ -371,7 +371,7 @@ class AbstractSequeue : public AbstractBase { | |||
| }; | |||
| using AbstractSequeuePtr = std::shared_ptr<AbstractSequeue>; | |||
| class AbstractTuple : public AbstractSequeue { | |||
| class MS_CORE_API AbstractTuple : public AbstractSequeue { | |||
| public: | |||
| explicit AbstractTuple(const AbstractBasePtrList &elements) : AbstractSequeue(elements) {} | |||
| @@ -400,7 +400,7 @@ class AbstractTuple : public AbstractSequeue { | |||
| }; | |||
| using AbstractTuplePtr = std::shared_ptr<AbstractTuple>; | |||
| class AbstractList : public AbstractSequeue { | |||
| class MS_CORE_API AbstractList : public AbstractSequeue { | |||
| public: | |||
| explicit AbstractList(const AbstractBasePtrList &elements) : AbstractSequeue(elements) {} | |||
| @@ -430,7 +430,7 @@ class AbstractList : public AbstractSequeue { | |||
| }; | |||
| using AbstractListPtr = std::shared_ptr<AbstractList>; | |||
| class AbstractClass : public AbstractBase { | |||
| class MS_CORE_API AbstractClass : public AbstractBase { | |||
| public: | |||
| AbstractClass(const Named &tag, const std::vector<AbstractAttribute> &attributes, | |||
| const std::unordered_map<std::string, ValuePtr> &methods) | |||
| @@ -462,7 +462,7 @@ class AbstractClass : public AbstractBase { | |||
| }; | |||
| using AbstractClassPtr = std::shared_ptr<AbstractClass>; | |||
| class AbstractDictionary : public AbstractBase { | |||
| class MS_CORE_API AbstractDictionary : public AbstractBase { | |||
| public: | |||
| explicit AbstractDictionary(const std::vector<AbstractAttribute> &key_values) : key_values_(key_values) {} | |||
| ~AbstractDictionary() override = default; | |||
| @@ -485,7 +485,7 @@ class AbstractDictionary : public AbstractBase { | |||
| }; | |||
| using AbstractDictionaryPtr = std::shared_ptr<AbstractDictionary>; | |||
| class AbstractSlice : public AbstractBase { | |||
| class MS_CORE_API AbstractSlice : public AbstractBase { | |||
| public: | |||
| AbstractSlice(const AbstractBasePtr &start, const AbstractBasePtr &stop, const AbstractBasePtr &step) | |||
| : start_(start), stop_(stop), step_(step) {} | |||
| @@ -513,7 +513,7 @@ class AbstractSlice : public AbstractBase { | |||
| }; | |||
| using AbstractSlicePtr = std::shared_ptr<AbstractSlice>; | |||
| class AbstractJTagged : public AbstractBase { | |||
| class MS_CORE_API AbstractJTagged : public AbstractBase { | |||
| public: | |||
| explicit AbstractJTagged(const AbstractBasePtr &element) : element_(element) {} | |||
| @@ -536,7 +536,7 @@ class AbstractJTagged : public AbstractBase { | |||
| }; | |||
| using AbstractJTaggedPtr = std::shared_ptr<AbstractJTagged>; | |||
| class AbstractNone : public AbstractBase { | |||
| class MS_CORE_API AbstractNone : public AbstractBase { | |||
| public: | |||
| AbstractNone() : AbstractBase() { set_type(std::make_shared<TypeNone>()); } | |||
| ~AbstractNone() override = default; | |||
| @@ -554,7 +554,7 @@ class AbstractNone : public AbstractBase { | |||
| using AbstractNonePtr = std::shared_ptr<AbstractNone>; | |||
| // the un assigned state value for variable, which means the variable is not assigned | |||
| class AbstractNull : public AbstractBase { | |||
| class MS_CORE_API AbstractNull : public AbstractBase { | |||
| public: | |||
| AbstractNull() : AbstractBase(kNull) { set_type(std::make_shared<TypeNull>()); } | |||
| ~AbstractNull() override = default; | |||
| @@ -569,7 +569,7 @@ class AbstractNull : public AbstractBase { | |||
| using AbstractNullPtr = std::shared_ptr<AbstractNull>; | |||
| // the timeout state value for variable, which means the variable is not assigned because it is timeout | |||
| class AbstractTimeOut : public AbstractBase { | |||
| class MS_CORE_API AbstractTimeOut : public AbstractBase { | |||
| public: | |||
| AbstractTimeOut() : AbstractBase(kNull) { set_type(std::make_shared<TypeNull>()); } | |||
| ~AbstractTimeOut() override = default; | |||
| @@ -583,7 +583,7 @@ class AbstractTimeOut : public AbstractBase { | |||
| }; | |||
| using AbstractTimeOutPtr = std::shared_ptr<AbstractTimeOut>; | |||
| class AbstractEllipsis : public AbstractBase { | |||
| class MS_CORE_API AbstractEllipsis : public AbstractBase { | |||
| public: | |||
| AbstractEllipsis() : AbstractBase(kEllipsis) { set_type(std::make_shared<TypeEllipsis>()); } | |||
| ~AbstractEllipsis() override = default; | |||
| @@ -597,7 +597,7 @@ class AbstractEllipsis : public AbstractBase { | |||
| }; | |||
| using AbstractEllipsisPtr = std::shared_ptr<AbstractEllipsis>; | |||
| class AbstractRefKey : public AbstractBase { | |||
| class MS_CORE_API AbstractRefKey : public AbstractBase { | |||
| public: | |||
| AbstractRefKey() : AbstractBase(), ref_key_value_(nullptr) { set_type(std::make_shared<RefKeyType>()); } | |||
| ~AbstractRefKey() override = default; | |||
| @@ -627,7 +627,7 @@ class AbstractRefKey : public AbstractBase { | |||
| }; | |||
| using AbstractRefKeyPtr = std::shared_ptr<AbstractRefKey>; | |||
| class AbstractRef : public AbstractTensor { | |||
| class MS_CORE_API AbstractRef : public AbstractTensor { | |||
| public: | |||
| AbstractRef(const AbstractBasePtr &ref_key, const AbstractTensorPtr &ref_value); | |||
| ~AbstractRef() override = default; | |||
| @@ -669,19 +669,19 @@ class AbstractRef : public AbstractTensor { | |||
| }; | |||
| using AbstractRefPtr = std::shared_ptr<AbstractRef>; | |||
| struct AbstractBasePtrListHasher { | |||
| struct MS_CORE_API AbstractBasePtrListHasher { | |||
| std::size_t operator()(const AbstractBasePtrList &args_spec_list) const; | |||
| }; | |||
| struct AbstractBasePtrListEqual { | |||
| struct MS_CORE_API AbstractBasePtrListEqual { | |||
| bool operator()(const AbstractBasePtrList &lhs, const AbstractBasePtrList &rhs) const; | |||
| }; | |||
| std::size_t AbstractBasePtrListHash(const AbstractBasePtrList &args_spec_list); | |||
| bool AbstractBasePtrListDeepEqual(const AbstractBasePtrList &lhs, const AbstractBasePtrList &rhs); | |||
| MS_CORE_API std::size_t AbstractBasePtrListHash(const AbstractBasePtrList &args_spec_list); | |||
| MS_CORE_API bool AbstractBasePtrListDeepEqual(const AbstractBasePtrList &lhs, const AbstractBasePtrList &rhs); | |||
| // RowTensor | |||
| class AbstractRowTensor : public AbstractUndetermined { | |||
| class MS_CORE_API AbstractRowTensor : public AbstractUndetermined { | |||
| public: | |||
| explicit AbstractRowTensor(const AbstractBasePtr &element, const BaseShapePtr &shape = std::make_shared<Shape>()) | |||
| : AbstractUndetermined(element, shape) {} | |||
| @@ -710,7 +710,7 @@ class AbstractRowTensor : public AbstractUndetermined { | |||
| }; | |||
| // SparseTensor | |||
| class AbstractSparseTensor : public AbstractUndetermined { | |||
| class MS_CORE_API AbstractSparseTensor : public AbstractUndetermined { | |||
| public: | |||
| explicit AbstractSparseTensor(const AbstractBasePtr &element, const BaseShapePtr &shape = std::make_shared<Shape>()) | |||
| : AbstractUndetermined(element, shape) {} | |||
| @@ -37,7 +37,7 @@ class BaseShape; | |||
| using BaseShapePtr = std::shared_ptr<BaseShape>; | |||
| using BaseShapePtrList = std::vector<BaseShapePtr>; | |||
| class BaseShape : public Base { | |||
| class MS_CORE_API BaseShape : public Base { | |||
| public: | |||
| BaseShape() = default; | |||
| ~BaseShape() override = default; | |||
| @@ -53,7 +53,7 @@ class BaseShape : public Base { | |||
| virtual void Broaden() {} | |||
| }; | |||
| class NoShape : public BaseShape { | |||
| class MS_CORE_API NoShape : public BaseShape { | |||
| public: | |||
| MS_DECLARE_PARENT(NoShape, BaseShape) | |||
| BaseShapePtr Clone() const override { return std::make_shared<NoShape>(); } | |||
| @@ -62,7 +62,7 @@ class NoShape : public BaseShape { | |||
| }; | |||
| extern const std::shared_ptr<NoShape> kNoShape; | |||
| class Shape : public BaseShape { | |||
| class MS_CORE_API Shape : public BaseShape { | |||
| public: | |||
| static const int64_t SHP_ANY = -1; | |||
| Shape() : shape_() {} | |||
| @@ -93,7 +93,7 @@ class Shape : public BaseShape { | |||
| using ShapePtr = std::shared_ptr<Shape>; | |||
| using ShapePtrList = std::vector<ShapePtr>; | |||
| class SequeueShape : public BaseShape { | |||
| class MS_CORE_API SequeueShape : public BaseShape { | |||
| public: | |||
| SequeueShape() : p_shapes_() {} | |||
| explicit SequeueShape(const BaseShapePtrList &shapes) : p_shapes_(shapes) {} | |||
| @@ -118,7 +118,7 @@ class SequeueShape : public BaseShape { | |||
| }; | |||
| using SequeueShapePtr = std::shared_ptr<SequeueShape>; | |||
| class TupleShape : public SequeueShape { | |||
| class MS_CORE_API TupleShape : public SequeueShape { | |||
| public: | |||
| TupleShape() : SequeueShape() {} | |||
| explicit TupleShape(const BaseShapePtrList &shapes) : SequeueShape(shapes) {} | |||
| @@ -133,7 +133,7 @@ class TupleShape : public SequeueShape { | |||
| }; | |||
| using TupleShapePtr = std::shared_ptr<TupleShape>; | |||
| class ListShape : public SequeueShape { | |||
| class MS_CORE_API ListShape : public SequeueShape { | |||
| public: | |||
| ListShape() : SequeueShape() {} | |||
| explicit ListShape(const BaseShapePtrList &shapes) : SequeueShape(shapes) {} | |||
| @@ -21,11 +21,12 @@ | |||
| #include <memory> | |||
| #include <string> | |||
| #include "utils/visible.h" | |||
| #include "api/ir/func_graph_manager.h" | |||
| namespace mindspore::api { | |||
| class FuncGraph { | |||
| class MS_CORE_API FuncGraph { | |||
| public: | |||
| FuncGraph() = default; | |||
| virtual ~FuncGraph() = default; | |||
| @@ -45,6 +46,8 @@ class FuncGraph { | |||
| virtual void set_attr(const std::string &key, const ValuePtr &value) = 0; | |||
| virtual FuncGraphManagerPtr get_manager() const = 0; | |||
| static std::vector<AnfNodePtr> TopoSort(const AnfNodePtr &node); | |||
| }; | |||
| } // namespace mindspore::api | |||
| #endif // MINDSPORE_CORE_API_IR_FUNC_GRAPH_H_ | |||
| @@ -20,6 +20,7 @@ | |||
| #include <memory> | |||
| #include <utility> | |||
| #include "utils/visible.h" | |||
| #include "utils/ordered_set.h" | |||
| #include "utils/ordered_map.h" | |||
| #include "ir/anf.h" | |||
| @@ -32,13 +33,13 @@ using FuncGraphPtr = std::shared_ptr<FuncGraph>; | |||
| class FuncGraphManager; | |||
| using FuncGraphManagerPtr = std::shared_ptr<FuncGraphManager>; | |||
| struct AnfNodeIndexPairHasher { | |||
| struct MS_CORE_API AnfNodeIndexPairHasher { | |||
| std::size_t operator()(const std::pair<AnfNodePtr, int> &p1) const { | |||
| return std::hash<const AnfNode *>{}(p1.first.get()); | |||
| } | |||
| }; | |||
| struct AnfNodeIndexPairEqual { | |||
| struct MS_CORE_API AnfNodeIndexPairEqual { | |||
| bool operator()(const std::pair<AnfNodePtr, int> &lhs, const std::pair<AnfNodePtr, int> &rhs) const { | |||
| return lhs == rhs; | |||
| } | |||
| @@ -47,7 +48,7 @@ struct AnfNodeIndexPairEqual { | |||
| using AnfNodeIndexSet = OrderedSet<std::pair<AnfNodePtr, int>, AnfNodeIndexPairHasher, AnfNodeIndexPairEqual>; | |||
| using NodeUsersMap = OrderedMap<AnfNodePtr, AnfNodeIndexSet>; | |||
| class FuncGraphManager { | |||
| class MS_CORE_API FuncGraphManager { | |||
| public: | |||
| FuncGraphManager() = default; | |||
| virtual ~FuncGraphManager() = default; | |||
| @@ -37,7 +37,7 @@ struct is_shared_ptr : public std::false_type {}; | |||
| template <typename T> | |||
| struct is_shared_ptr<std::shared_ptr<T>> : public std::true_type {}; | |||
| class Base : public std::enable_shared_from_this<Base> { | |||
| class MS_CORE_API Base : public std::enable_shared_from_this<Base> { | |||
| public: | |||
| constexpr Base() = default; | |||
| Base(const Base &other) : std::enable_shared_from_this<Base>(other) {} | |||
| @@ -96,7 +96,7 @@ using ParamInfoPtr = std::shared_ptr<ParamInfo>; | |||
| // input of other CNodes, you can get the related info by this method. | |||
| // debug_info: return the information retrieved from parser. Set it using set_debug_info. | |||
| // fullname_with_scope: return the detailed debug info. | |||
| class AnfNode : public Base { | |||
| class MS_CORE_API AnfNode : public Base { | |||
| public: | |||
| explicit AnfNode(const FuncGraphPtr &func_graph) | |||
| : func_graph_(FuncGraphWeakPtr(func_graph)), | |||
| @@ -234,7 +234,7 @@ class AnfNode : public Base { | |||
| // stop_gradient_: a flag used to stop gradient. | |||
| // Using stop_gradient() to get this flag, mainly used in ad. | |||
| // Using set_stop_gradient() to set this flag. | |||
| class CNode : public AnfNode, public EffectInfoHolder { | |||
| class MS_CORE_API CNode : public AnfNode, public EffectInfoHolder { | |||
| public: | |||
| CNode(const std::vector<AnfNodePtr> &inputs, const FuncGraphPtr &func_graph); | |||
| CNode(const std::vector<AnfNodePtr> &inputs, const VarPtr &func_graph_as_var) | |||
| @@ -365,7 +365,7 @@ class CNode : public AnfNode, public EffectInfoHolder { | |||
| }; | |||
| // ANode represents the atomic node. It's derived Parameter and ValueNode. | |||
| class ANode : public AnfNode { | |||
| class MS_CORE_API ANode : public AnfNode { | |||
| public: | |||
| ANode() : AnfNode(nullptr) {} | |||
| explicit ANode(const FuncGraphPtr &func_graph) : AnfNode(func_graph) {} | |||
| @@ -377,7 +377,7 @@ class ANode : public AnfNode { | |||
| // Parameter represents the parameter inputs of a function. They have no value. | |||
| // Attributes: | |||
| // default_param_value_: used to hold the inputting tensor of the model. | |||
| class Parameter : public ANode { | |||
| class MS_CORE_API Parameter : public ANode { | |||
| public: | |||
| explicit Parameter(const FuncGraphPtr &func_graph) | |||
| : ANode(func_graph), name_(""), has_default_(false), default_param_(nullptr), used_graph_count_(0) {} | |||
| @@ -443,7 +443,7 @@ using ParameterPtr = std::shared_ptr<Parameter>; | |||
| // Value is used to represent the atomic expression mentioned in BNF. | |||
| // It mainly be stored in ValueNode. Value and ValueNode is related definition. | |||
| class Value : public Base { | |||
| class MS_CORE_API Value : public Base { | |||
| public: | |||
| Value() = default; | |||
| explicit Value(const TypePtr t) : type_(t) {} | |||
| @@ -469,7 +469,7 @@ class Value : public Base { | |||
| // ValueNode is used to hold value. Unlike CNode and Parameter, ValueNode | |||
| // does not belong to any particular function graph. | |||
| class ValueNode : public ANode { | |||
| class MS_CORE_API ValueNode : public ANode { | |||
| public: | |||
| explicit ValueNode(const ValuePtr &value) : value_(value) {} | |||
| ~ValueNode() override = default; | |||
| @@ -31,7 +31,7 @@ using abstract::AbstractBasePtr; | |||
| using abstract::AbstractBasePtrList; | |||
| // value for Cell | |||
| class Cell : public Named { | |||
| class MS_CORE_API Cell : public Named { | |||
| public: | |||
| explicit Cell(const std::string &name) : Named(name) {} | |||
| MS_DECLARE_PARENT(Cell, Named); | |||
| @@ -42,9 +42,9 @@ | |||
| /* namespace to support intermediate representation definition */ | |||
| namespace mindspore { | |||
| // Only few type supported now. | |||
| TypePtr TypeIdToType(TypeId id); | |||
| MS_CORE_API TypePtr TypeIdToType(TypeId id); | |||
| class String : public Object { | |||
| class MS_CORE_API String : public Object { | |||
| public: | |||
| String() : Object(kObjectTypeString, false) {} | |||
| ~String() override = default; | |||
| @@ -59,7 +59,7 @@ class String : public Object { | |||
| }; | |||
| using StringPtr = std::shared_ptr<String>; | |||
| class Keyword : public Object { | |||
| class MS_CORE_API Keyword : public Object { | |||
| public: | |||
| Keyword() : Object(kObjectTypeKeyword, false), key_(""), value_(nullptr) {} | |||
| Keyword(const std::string &key, const TypePtr &value) : Object(kObjectTypeKeyword, false), key_(key), value_(value) {} | |||
| @@ -83,7 +83,7 @@ class Keyword : public Object { | |||
| }; | |||
| using KeywordPtr = std::shared_ptr<Keyword>; | |||
| class Slice : public Object { | |||
| class MS_CORE_API Slice : public Object { | |||
| public: | |||
| Slice() : Object(kObjectTypeSlice), start_(nullptr), stop_(nullptr), step_(nullptr) {} | |||
| Slice(const TypePtr &start, const TypePtr &stop, const TypePtr &step) | |||
| @@ -110,7 +110,7 @@ class Slice : public Object { | |||
| }; | |||
| using SlicePtr = std::shared_ptr<Slice>; | |||
| class Function : public Object { | |||
| class MS_CORE_API Function : public Object { | |||
| public: | |||
| Function(); | |||
| Function(const std::vector<TypePtr> &args, const TypePtr retval); | |||
| @@ -135,7 +135,7 @@ class Function : public Object { | |||
| }; | |||
| using FunctionPtr = std::shared_ptr<Function>; | |||
| class JTagged : public Object { | |||
| class MS_CORE_API JTagged : public Object { | |||
| public: | |||
| JTagged() : Object(kObjectTypeJTagged) {} | |||
| explicit JTagged(const TypePtr &subtype) : Object(kObjectTypeJTagged, false), subtype_(subtype) {} | |||
| @@ -153,7 +153,7 @@ class JTagged : public Object { | |||
| }; | |||
| using JTaggedPtr = std::shared_ptr<JTagged>; | |||
| class SymbolicKeyType : public Object { | |||
| class MS_CORE_API SymbolicKeyType : public Object { | |||
| public: | |||
| SymbolicKeyType() : Object(kObjectTypeSymbolicKeyType) {} | |||
| ~SymbolicKeyType() override = default; | |||
| @@ -165,7 +165,7 @@ class SymbolicKeyType : public Object { | |||
| std::string DumpText() const override { return "SymType"; } | |||
| }; | |||
| class EnvType : public Object { | |||
| class MS_CORE_API EnvType : public Object { | |||
| public: | |||
| EnvType() : Object(kObjectTypeEnvType) {} | |||
| ~EnvType() override = default; | |||
| @@ -177,7 +177,7 @@ class EnvType : public Object { | |||
| }; | |||
| using EnvTypePtr = std::shared_ptr<EnvType>; | |||
| class TypeType : public Type { | |||
| class MS_CORE_API TypeType : public Type { | |||
| public: | |||
| TypeType() : Type(kMetaTypeTypeType) {} | |||
| ~TypeType() override = default; | |||
| @@ -190,7 +190,7 @@ class TypeType : public Type { | |||
| }; | |||
| using TypeTypePtr = std::shared_ptr<TypeType>; | |||
| class Problem : public Type { | |||
| class MS_CORE_API Problem : public Type { | |||
| public: | |||
| Problem() : Type(kMetaTypeProblem), kind_(Named("unknown")) {} | |||
| explicit Problem(const Named &kind) : Type(kMetaTypeProblem), kind_(kind) {} | |||
| @@ -209,7 +209,7 @@ class Problem : public Type { | |||
| }; | |||
| using ProblemPtr = std::shared_ptr<Problem>; | |||
| class External : public Type { | |||
| class MS_CORE_API External : public Type { | |||
| public: | |||
| External() : Type(kMetaTypeExternal) {} | |||
| ~External() override = default; | |||
| @@ -230,39 +230,39 @@ TypePtr Clone(const T &t) { | |||
| return t.Clone(); | |||
| } | |||
| TypePtr StringToType(const std::string &type_name); | |||
| MS_CORE_API TypePtr StringToType(const std::string &type_name); | |||
| // Judge whether x is predicate or is a subclass of predicate. | |||
| bool IsIdentidityOrSubclass(TypePtr const &x, TypePtr const &base_type); | |||
| MS_CORE_API bool IsIdentidityOrSubclass(TypePtr const &x, TypePtr const &base_type); | |||
| // Whether t1 is identity or a subclass of t2. | |||
| bool IsSubType(TypePtr const &t1, TypePtr const &t2 = nullptr); | |||
| MS_CORE_API bool IsSubType(TypePtr const &t1, TypePtr const &t2 = nullptr); | |||
| struct TypeHasher { | |||
| struct MS_CORE_API TypeHasher { | |||
| std::size_t operator()(TypePtr const &type) const; | |||
| }; | |||
| struct TypeListHasher { | |||
| struct MS_CORE_API TypeListHasher { | |||
| std::size_t operator()(const TypePtrList &type_list) const; | |||
| }; | |||
| struct TypeEqual { | |||
| struct MS_CORE_API TypeEqual { | |||
| bool operator()(TypePtr const &t1, TypePtr const &t2) const; | |||
| }; | |||
| struct TypeListEqual { | |||
| struct MS_CORE_API TypeListEqual { | |||
| bool operator()(TypePtrList const &lhs, TypePtrList const &rhs) const; | |||
| }; | |||
| extern const TypePtr kTypeExternal; | |||
| extern const TypePtr kTypeEnv; | |||
| extern const TypePtr kTypeType; | |||
| extern const TypePtr kString; | |||
| extern const TypePtr kList; | |||
| extern const TypePtr kTuple; | |||
| extern const TypePtr kDict; | |||
| extern const TypePtr kSlice; | |||
| extern const TypePtr kKeyword; | |||
| extern const TypePtr kTensorType; | |||
| extern const TypePtr kTensorTypeFP16; | |||
| extern const TypePtr kTensorTypeFP32; | |||
| MS_CORE_API extern const TypePtr kTypeExternal; | |||
| MS_CORE_API extern const TypePtr kTypeEnv; | |||
| MS_CORE_API extern const TypePtr kTypeType; | |||
| MS_CORE_API extern const TypePtr kString; | |||
| MS_CORE_API extern const TypePtr kList; | |||
| MS_CORE_API extern const TypePtr kTuple; | |||
| MS_CORE_API extern const TypePtr kDict; | |||
| MS_CORE_API extern const TypePtr kSlice; | |||
| MS_CORE_API extern const TypePtr kKeyword; | |||
| MS_CORE_API extern const TypePtr kTensorType; | |||
| MS_CORE_API extern const TypePtr kTensorTypeFP16; | |||
| MS_CORE_API extern const TypePtr kTensorTypeFP32; | |||
| } // namespace mindspore | |||
| #endif // MINDSPORE_CORE_IR_DTYPE_H_ | |||
| @@ -37,7 +37,7 @@ namespace mindspore { | |||
| // TypeRefKey type | |||
| // List | |||
| class List : public Object { | |||
| class MS_CORE_API List : public Object { | |||
| public: | |||
| List() : Object(kObjectTypeList) {} | |||
| List(const std::initializer_list<TypePtr> &objs) | |||
| @@ -65,7 +65,7 @@ using ListPtr = std::shared_ptr<List>; | |||
| using ClassAttrVector = std::vector<std::pair<std::string, TypePtr>>; | |||
| class Class : public Object { | |||
| class MS_CORE_API Class : public Object { | |||
| public: | |||
| Class() : Object(kObjectTypeClass), tag_(Named("Class")) {} | |||
| Class(const Named &tag, const ClassAttrVector &attributes, const std::unordered_map<std::string, ValuePtr> &methods); | |||
| @@ -95,7 +95,7 @@ class Class : public Object { | |||
| }; | |||
| using ClassPtr = std::shared_ptr<Class>; | |||
| class Tuple : public Object { | |||
| class MS_CORE_API Tuple : public Object { | |||
| public: | |||
| Tuple() : Object(kObjectTypeTuple) {} | |||
| // usage : Tuple t = {std::make_shared<Bool>(), std::make_shared<Int>(32)}; | |||
| @@ -125,7 +125,7 @@ class Tuple : public Object { | |||
| }; | |||
| using TuplePtr = std::shared_ptr<Tuple>; | |||
| class Dictionary : public Object { | |||
| class MS_CORE_API Dictionary : public Object { | |||
| public: | |||
| Dictionary() : Object(kObjectTypeDictionary) {} | |||
| explicit Dictionary(const std::vector<std::pair<std::string, TypePtr>> &key_values) | |||
| @@ -34,7 +34,7 @@ | |||
| #include "ir/dtype/type.h" | |||
| namespace mindspore { | |||
| class TypeAnything : public Type { | |||
| class MS_CORE_API TypeAnything : public Type { | |||
| public: | |||
| TypeAnything() : Type(kMetaTypeAnything) {} | |||
| ~TypeAnything() override {} | |||
| @@ -46,7 +46,7 @@ class TypeAnything : public Type { | |||
| }; | |||
| using TypeAnythingPtr = std::shared_ptr<TypeAnything>; | |||
| class TypeNone : public Type { | |||
| class MS_CORE_API TypeNone : public Type { | |||
| public: | |||
| TypeNone() : Type(kMetaTypeNone) {} | |||
| ~TypeNone() override {} | |||
| @@ -59,7 +59,7 @@ class TypeNone : public Type { | |||
| }; | |||
| using TypeNonePtr = std::shared_ptr<TypeNone>; | |||
| class TypeNull : public Type { | |||
| class MS_CORE_API TypeNull : public Type { | |||
| public: | |||
| TypeNull() : Type(kMetaTypeNull) {} | |||
| ~TypeNull() override {} | |||
| @@ -71,7 +71,7 @@ class TypeNull : public Type { | |||
| }; | |||
| using TypeNullPtr = std::shared_ptr<TypeNull>; | |||
| class TypeEllipsis : public Type { | |||
| class MS_CORE_API TypeEllipsis : public Type { | |||
| public: | |||
| TypeEllipsis() : Type(kMetaTypeEllipsis) {} | |||
| ~TypeEllipsis() override {} | |||
| @@ -84,10 +84,10 @@ class TypeEllipsis : public Type { | |||
| }; | |||
| using TypeEllipsisPtr = std::shared_ptr<TypeEllipsis>; | |||
| extern const TypePtr kTypeNone; | |||
| extern const TypePtr kTypeNull; | |||
| extern const TypePtr kTypeEllipsis; | |||
| extern const TypePtr kAnyType; | |||
| MS_CORE_API extern const TypePtr kTypeNone; | |||
| MS_CORE_API extern const TypePtr kTypeNull; | |||
| MS_CORE_API extern const TypePtr kTypeEllipsis; | |||
| MS_CORE_API extern const TypePtr kAnyType; | |||
| } // namespace mindspore | |||
| #endif // MINDSPORE_CORE_IR_DTYPE_EMPTY_H_ | |||
| @@ -35,7 +35,7 @@ | |||
| namespace mindspore { | |||
| // Number, abstract class. | |||
| class Number : public Object { | |||
| class MS_CORE_API Number : public Object { | |||
| public: | |||
| Number() : Object(kObjectTypeNumber), number_type_(kObjectTypeNumber), nbits_(0) {} | |||
| Number(const TypeId number_type, const int nbits, bool is_generic = true) | |||
| @@ -71,7 +71,7 @@ class Number : public Object { | |||
| using NumberPtr = std::shared_ptr<Number>; | |||
| // Bool | |||
| class Bool : public Number { | |||
| class MS_CORE_API Bool : public Number { | |||
| public: | |||
| Bool() : Number(kNumberTypeBool, 8) {} | |||
| ~Bool() override = default; | |||
| @@ -85,7 +85,7 @@ class Bool : public Number { | |||
| }; | |||
| // Int | |||
| class Int : public Number { | |||
| class MS_CORE_API Int : public Number { | |||
| public: | |||
| Int() : Number(kNumberTypeInt, 0) {} | |||
| explicit Int(const int nbits); | |||
| @@ -106,7 +106,7 @@ class Int : public Number { | |||
| }; | |||
| // UInt | |||
| class UInt : public Number { | |||
| class MS_CORE_API UInt : public Number { | |||
| public: | |||
| UInt() : Number(kNumberTypeUInt, 0) {} | |||
| explicit UInt(const int nbits); | |||
| @@ -129,7 +129,7 @@ class UInt : public Number { | |||
| }; | |||
| // Float | |||
| class Float : public Number { | |||
| class MS_CORE_API Float : public Number { | |||
| public: | |||
| Float() : Number(kNumberTypeFloat, 0) {} | |||
| explicit Float(const int nbits); | |||
| @@ -151,7 +151,7 @@ class Float : public Number { | |||
| }; | |||
| // Complex64 | |||
| class Complex64 : public Number { | |||
| class MS_CORE_API Complex64 : public Number { | |||
| public: | |||
| Complex64() : Number(kNumberTypeComplex64, 64, false) {} | |||
| ~Complex64() override {} | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| // TypeRefKey type | |||
| class RefKeyType : public Object { | |||
| class MS_CORE_API RefKeyType : public Object { | |||
| public: | |||
| RefKeyType() : Object(kObjectTypeRefKey) {} | |||
| ~RefKeyType() override {} | |||
| @@ -40,7 +40,7 @@ class RefKeyType : public Object { | |||
| }; | |||
| // TypeRef type | |||
| class RefType : public TensorType { | |||
| class MS_CORE_API RefType : public TensorType { | |||
| public: | |||
| RefType() : TensorType() {} | |||
| explicit RefType(const TensorTypePtr &subtype) : TensorType(subtype->element()) {} | |||
| @@ -53,8 +53,8 @@ class RefType : public TensorType { | |||
| }; | |||
| using RefTypePtr = std::shared_ptr<RefType>; | |||
| extern const TypePtr kRefKeyType; | |||
| extern const TypePtr kRefType; | |||
| MS_CORE_API extern const TypePtr kRefKeyType; | |||
| MS_CORE_API extern const TypePtr kRefType; | |||
| } // namespace mindspore | |||
| #endif // MINDSPORE_CORE_IR_DTYPE_REF_H_ | |||
| @@ -34,7 +34,7 @@ | |||
| #include "ir/dtype/type.h" | |||
| namespace mindspore { | |||
| class UndeterminedType : public Object { | |||
| class MS_CORE_API UndeterminedType : public Object { | |||
| public: | |||
| UndeterminedType() : Object(kObjectTypeUndeterminedType) {} | |||
| explicit UndeterminedType(const TypePtr &ele) | |||
| @@ -57,7 +57,7 @@ class UndeterminedType : public Object { | |||
| }; | |||
| using MetaTensorTypePtr = std::shared_ptr<UndeterminedType>; | |||
| class TensorType : public Object { | |||
| class MS_CORE_API TensorType : public Object { | |||
| public: | |||
| TensorType() : Object(kObjectTypeTensorType, kObjectTypeUndeterminedType) {} | |||
| explicit TensorType(const TypePtr &ele) | |||
| @@ -80,7 +80,7 @@ class TensorType : public Object { | |||
| }; | |||
| using TensorTypePtr = std::shared_ptr<TensorType>; | |||
| class RowTensorType : public Object { | |||
| class MS_CORE_API RowTensorType : public Object { | |||
| public: | |||
| RowTensorType() : Object(kObjectTypeRowTensorType, kObjectTypeUndeterminedType) {} | |||
| explicit RowTensorType(const TypePtr &ele) | |||
| @@ -103,7 +103,7 @@ class RowTensorType : public Object { | |||
| }; | |||
| using RowTensorTypePtr = std::shared_ptr<RowTensorType>; | |||
| class SparseTensorType : public Object { | |||
| class MS_CORE_API SparseTensorType : public Object { | |||
| public: | |||
| SparseTensorType() : Object(kObjectTypeSparseTensorType, kObjectTypeUndeterminedType) {} | |||
| explicit SparseTensorType(const TypePtr &ele) | |||
| @@ -49,7 +49,7 @@ size_t GetTypeByte(const TypePtr &type_ptr); | |||
| // Base class for all types | |||
| // forward declaration. | |||
| class Type : public Value { | |||
| class MS_CORE_API Type : public Value { | |||
| public: | |||
| Type() : meta_type_(kMetaTypeType), is_generic_(true) {} | |||
| explicit Type(TypeId t, bool is_generic = true) : meta_type_(t), is_generic_(is_generic) {} | |||
| @@ -94,7 +94,7 @@ using TypePtrList = std::vector<TypePtr>; | |||
| // | |||
| // Base class for normal objects | |||
| // | |||
| class Object : public Type { | |||
| class MS_CORE_API Object : public Type { | |||
| public: | |||
| Object() : Type(kMetaTypeObject), object_type_(kMetaTypeObject), parent_type_(kMetaTypeObject) {} | |||
| explicit Object(const TypeId object_type, bool is_generic = true) | |||
| @@ -132,7 +132,7 @@ const std::unordered_map<TypeId, int> type_priority_map = { | |||
| {kNumberTypeInt16, 3}, {kNumberTypeInt32, 4}, {kNumberTypeInt64, 5}, | |||
| {kNumberTypeFloat16, 6}, {kNumberTypeFloat32, 7}, {kNumberTypeFloat64, 8}}; | |||
| std::ostream &operator<<(std::ostream &os, const TypePtrList &types); | |||
| MS_CORE_API std::ostream &operator<<(std::ostream &os, const TypePtrList &types); | |||
| } // namespace mindspore | |||
| #endif // MINDSPORE_CORE_IR_DTYPE_TYPE_H_ | |||
| @@ -632,7 +632,7 @@ std::list<CNodePtr> FuncGraph::GetOrderedCnodes() { | |||
| auto SuccDepends = std::bind(SuccIncludeFV, this_ptr, std::placeholders::_1); | |||
| std::list<CNodePtr> cnodes; | |||
| auto nodes = TopoSort(get_return(), SuccDepends, BelongSameGraph); | |||
| auto nodes = mindspore::TopoSort(get_return(), SuccDepends, BelongSameGraph); | |||
| for (const auto &node : nodes) { | |||
| auto cnode = dyn_cast<CNode>(node); | |||
| if (cnode) { | |||
| @@ -727,7 +727,7 @@ bool FuncGraph::ContainMultiTarget() const { | |||
| MS_EXCEPTION_IF_NULL(graph_manager); | |||
| FuncGraphSet graphs = graph_manager->func_graphs(); | |||
| for (auto &g : graphs) { | |||
| auto nodes = TopoSort(g->get_return()); | |||
| auto nodes = mindspore::TopoSort(g->get_return()); | |||
| if (mindspore::ContainMultiTarget(nodes)) { | |||
| return true; | |||
| } | |||
| @@ -740,5 +740,8 @@ size_t NewFgSeenGeneration() { | |||
| return ++fg_seen_generation; | |||
| } | |||
| // Implement TopoSort api. | |||
| std::vector<AnfNodePtr> api::FuncGraph::TopoSort(const AnfNodePtr &node) { return mindspore::TopoSort(node); } | |||
| const PrimitivePtr FuncGraphTransform::func_graph_prim_ = std::make_shared<Primitive>("FuncGraph"); | |||
| } // namespace mindspore | |||
| @@ -55,7 +55,7 @@ struct DeviceInfo { | |||
| // | |||
| // Includes the metadata information of a tensor, such as data type, shape | |||
| // and so on. But it does not contain values of a tensor. | |||
| class MetaTensor : public Value { | |||
| class MS_CORE_API MetaTensor : public Value { | |||
| public: | |||
| // Construction | |||
| MetaTensor(); | |||
| @@ -24,7 +24,7 @@ | |||
| #include "ir/anf.h" | |||
| namespace mindspore { | |||
| class Named : public Value { | |||
| class MS_CORE_API Named : public Value { | |||
| public: | |||
| explicit Named(const std::string &name) : name_(name) { hash_id_ = std::hash<std::string>{}(name); } | |||
| Named(const Named &other) : Value(other) { | |||
| @@ -62,14 +62,14 @@ class Named : public Value { | |||
| }; | |||
| using NamedPtr = std::shared_ptr<Named>; | |||
| struct NamedHasher { | |||
| struct MS_CORE_API NamedHasher { | |||
| std::size_t operator()(NamedPtr const &name) const { | |||
| std::size_t hash = name->Hash(); | |||
| return hash; | |||
| } | |||
| }; | |||
| struct NamedEqual { | |||
| struct MS_CORE_API NamedEqual { | |||
| bool operator()(NamedPtr const &t1, NamedPtr const &t2) const { | |||
| MS_EXCEPTION_IF_NULL(t1); | |||
| MS_EXCEPTION_IF_NULL(t2); | |||
| @@ -77,31 +77,31 @@ struct NamedEqual { | |||
| } | |||
| }; | |||
| class None : public Named { | |||
| class MS_CORE_API None : public Named { | |||
| public: | |||
| None() : Named("None") {} | |||
| ~None() override = default; | |||
| MS_DECLARE_PARENT(None, Named); | |||
| abstract::AbstractBasePtr ToAbstract() override; | |||
| }; | |||
| extern const NamedPtr kNone; | |||
| MS_CORE_API extern const NamedPtr kNone; | |||
| class Null : public Named { | |||
| class MS_CORE_API Null : public Named { | |||
| public: | |||
| Null() : Named("Null") {} | |||
| ~Null() override = default; | |||
| MS_DECLARE_PARENT(Null, Named); | |||
| abstract::AbstractBasePtr ToAbstract() override; | |||
| }; | |||
| extern const NamedPtr kNull; | |||
| MS_CORE_API extern const NamedPtr kNull; | |||
| class Ellipsis : public Named { | |||
| class MS_CORE_API Ellipsis : public Named { | |||
| public: | |||
| Ellipsis() : Named("Ellipsis") {} | |||
| ~Ellipsis() override = default; | |||
| MS_DECLARE_PARENT(Ellipsis, Named); | |||
| abstract::AbstractBasePtr ToAbstract() override; | |||
| }; | |||
| extern const NamedPtr kEllipsis; | |||
| MS_CORE_API extern const NamedPtr kEllipsis; | |||
| } // namespace mindspore | |||
| #endif // MINDSPORE_CORE_IR_NAMED_H_ | |||
| @@ -38,7 +38,7 @@ enum PrimType { | |||
| kPrimTypePyCheck // Primitive operator with input args checking method | |||
| }; | |||
| class Primitive : public Named { | |||
| class MS_CORE_API Primitive : public Named { | |||
| public: | |||
| explicit Primitive(const std::string &name, const bool is_base = true, const PrimType prim_type = kPrimTypeBuiltIn); | |||
| Primitive(const std::string &name, const std::unordered_map<std::string, ValuePtr> &attrs); | |||
| @@ -142,7 +142,7 @@ inline std::ostream &operator<<(std::ostream &os, const PrimitivePtr &p) { | |||
| return os; | |||
| } | |||
| struct PrimitiveEqual { | |||
| struct MS_CORE_API PrimitiveEqual { | |||
| bool operator()(PrimitivePtr const &t1, PrimitivePtr const &t2) const { | |||
| MS_EXCEPTION_IF_NULL(t1); | |||
| MS_EXCEPTION_IF_NULL(t2); | |||
| @@ -150,14 +150,14 @@ struct PrimitiveEqual { | |||
| } | |||
| }; | |||
| struct PrimitiveHasher { | |||
| struct MS_CORE_API PrimitiveHasher { | |||
| std::size_t operator()(PrimitivePtr const &prim) const { | |||
| MS_EXCEPTION_IF_NULL(prim); | |||
| return prim->Hash(); | |||
| } | |||
| }; | |||
| struct PrimitiveTotalEqual { | |||
| struct MS_CORE_API PrimitiveTotalEqual { | |||
| bool operator()(PrimitivePtr const &t1, PrimitivePtr const &t2) const { | |||
| MS_EXCEPTION_IF_NULL(t1); | |||
| MS_EXCEPTION_IF_NULL(t2); | |||
| @@ -35,7 +35,7 @@ | |||
| using std::fabs; | |||
| namespace mindspore { | |||
| class Scalar : public Value { | |||
| class MS_CORE_API Scalar : public Value { | |||
| public: | |||
| Scalar() = default; | |||
| explicit Scalar(const TypePtr t) : Value(t) {} | |||
| @@ -50,7 +50,7 @@ class Scalar : public Value { | |||
| }; | |||
| using ScalarPtr = std::shared_ptr<Scalar>; | |||
| class BoolImm : public Scalar { | |||
| class MS_CORE_API BoolImm : public Scalar { | |||
| public: | |||
| explicit BoolImm(bool b) : Scalar(kBool), v_(b) { hash_ = hash_combine({tid(), std::hash<bool>{}(v_)}); } | |||
| ~BoolImm() override = default; | |||
| @@ -81,7 +81,7 @@ class BoolImm : public Scalar { | |||
| using BoolImmPtr = std::shared_ptr<BoolImm>; | |||
| IMM_TRAITS(BoolImmPtr, bool) | |||
| class IntergerImm : public Scalar { | |||
| class MS_CORE_API IntergerImm : public Scalar { | |||
| public: | |||
| IntergerImm() = default; | |||
| explicit IntergerImm(const TypePtr &t) : Scalar(t) {} | |||
| @@ -89,7 +89,7 @@ class IntergerImm : public Scalar { | |||
| MS_DECLARE_PARENT(IntergerImm, Scalar) | |||
| }; | |||
| class Int8Imm : public IntergerImm { | |||
| class MS_CORE_API Int8Imm : public IntergerImm { | |||
| public: | |||
| Int8Imm() : IntergerImm(kInt8), v_(0) {} | |||
| explicit Int8Imm(int8_t v) : IntergerImm(kInt8), v_(v) { hash_ = hash_combine({tid(), std::hash<int>{}(v_)}); } | |||
| @@ -115,7 +115,7 @@ class Int8Imm : public IntergerImm { | |||
| using Int8ImmPtr = std::shared_ptr<Int8Imm>; | |||
| IMM_TRAITS(Int8ImmPtr, int8_t) | |||
| class Int16Imm : public IntergerImm { | |||
| class MS_CORE_API Int16Imm : public IntergerImm { | |||
| public: | |||
| Int16Imm() : IntergerImm(kInt16), v_(0) {} | |||
| explicit Int16Imm(int16_t v) : IntergerImm(kInt16), v_(v) { hash_ = hash_combine({tid(), std::hash<int>{}(v_)}); } | |||
| @@ -141,7 +141,7 @@ class Int16Imm : public IntergerImm { | |||
| using Int16ImmPtr = std::shared_ptr<Int16Imm>; | |||
| IMM_TRAITS(Int16ImmPtr, int16_t) | |||
| class Int32Imm : public IntergerImm { | |||
| class MS_CORE_API Int32Imm : public IntergerImm { | |||
| public: | |||
| Int32Imm() : IntergerImm(kInt32), v_(0) {} | |||
| explicit Int32Imm(int v) : IntergerImm(kInt32), v_(v) { hash_ = hash_combine({tid(), std::hash<int>{}(v_)}); } | |||
| @@ -167,7 +167,7 @@ class Int32Imm : public IntergerImm { | |||
| using Int32ImmPtr = std::shared_ptr<Int32Imm>; | |||
| IMM_TRAITS(Int32ImmPtr, int32_t) | |||
| class Int64Imm : public IntergerImm { | |||
| class MS_CORE_API Int64Imm : public IntergerImm { | |||
| public: | |||
| Int64Imm() : IntergerImm(kInt64), v_(0) {} | |||
| explicit Int64Imm(int64_t v) : IntergerImm(kInt64), v_(v) { hash_ = hash_combine({tid(), std::hash<int64_t>{}(v_)}); } | |||
| @@ -193,7 +193,7 @@ class Int64Imm : public IntergerImm { | |||
| using Int64ImmPtr = std::shared_ptr<Int64Imm>; | |||
| IMM_TRAITS(Int64ImmPtr, int64_t) | |||
| class UInt8Imm : public IntergerImm { | |||
| class MS_CORE_API UInt8Imm : public IntergerImm { | |||
| public: | |||
| UInt8Imm() : IntergerImm(kUInt8), v_(0) {} | |||
| explicit UInt8Imm(uint8_t v) : IntergerImm(kUInt8), v_(v) { | |||
| @@ -221,7 +221,7 @@ class UInt8Imm : public IntergerImm { | |||
| using UInt8ImmPtr = std::shared_ptr<UInt8Imm>; | |||
| IMM_TRAITS(UInt8ImmPtr, uint8_t); | |||
| class UInt16Imm : public IntergerImm { | |||
| class MS_CORE_API UInt16Imm : public IntergerImm { | |||
| public: | |||
| UInt16Imm() : IntergerImm(kUInt16), v_(0) {} | |||
| explicit UInt16Imm(uint16_t v) : IntergerImm(kUInt16), v_(v) { | |||
| @@ -249,7 +249,7 @@ class UInt16Imm : public IntergerImm { | |||
| using UInt16ImmPtr = std::shared_ptr<UInt16Imm>; | |||
| IMM_TRAITS(UInt16ImmPtr, uint16_t); | |||
| class UInt32Imm : public IntergerImm { | |||
| class MS_CORE_API UInt32Imm : public IntergerImm { | |||
| public: | |||
| UInt32Imm() : IntergerImm(kUInt32), v_(0) {} | |||
| explicit UInt32Imm(uint32_t v) : IntergerImm(kUInt32), v_(v) { | |||
| @@ -277,7 +277,7 @@ class UInt32Imm : public IntergerImm { | |||
| using UInt32ImmPtr = std::shared_ptr<UInt32Imm>; | |||
| IMM_TRAITS(UInt32ImmPtr, uint32_t); | |||
| class UInt64Imm : public IntergerImm { | |||
| class MS_CORE_API UInt64Imm : public IntergerImm { | |||
| public: | |||
| UInt64Imm() : IntergerImm(kUInt64), v_(0) {} | |||
| explicit UInt64Imm(uint64_t v) : IntergerImm(kUInt64), v_(v) { | |||
| @@ -305,7 +305,7 @@ class UInt64Imm : public IntergerImm { | |||
| using UInt64ImmPtr = std::shared_ptr<UInt64Imm>; | |||
| IMM_TRAITS(UInt64ImmPtr, uint64_t); | |||
| class FloatImm : public Scalar { | |||
| class MS_CORE_API FloatImm : public Scalar { | |||
| public: | |||
| FloatImm() = default; | |||
| explicit FloatImm(const TypePtr &t) : Scalar(t) {} | |||
| @@ -314,7 +314,7 @@ class FloatImm : public Scalar { | |||
| }; | |||
| using FloatImmPtr = std::shared_ptr<FloatImm>; | |||
| class FP32Imm : public FloatImm { | |||
| class MS_CORE_API FP32Imm : public FloatImm { | |||
| public: | |||
| FP32Imm() : FloatImm(kFloat32), v_(0.0) {} | |||
| explicit FP32Imm(float v) : FloatImm(kFloat32), v_(v) { hash_ = hash_combine({tid(), std::hash<float>{}(v_)}); } | |||
| @@ -340,7 +340,7 @@ class FP32Imm : public FloatImm { | |||
| using FP32ImmPtr = std::shared_ptr<FP32Imm>; | |||
| IMM_TRAITS(FP32ImmPtr, float) | |||
| class FP64Imm : public FloatImm { | |||
| class MS_CORE_API FP64Imm : public FloatImm { | |||
| public: | |||
| FP64Imm() : FloatImm(kFloat64), v_(0.0) {} | |||
| explicit FP64Imm(double v) : FloatImm(kFloat64), v_(v) { hash_ = hash_combine({tid(), std::hash<double>{}(v_)}); } | |||
| @@ -19,6 +19,7 @@ | |||
| #include <string> | |||
| #include <memory> | |||
| #include <stack> | |||
| namespace mindspore { | |||
| class Scope; | |||
| using ScopePtr = std::shared_ptr<Scope>; | |||
| @@ -42,7 +42,7 @@ enum TensorSyncStatus { kNoNeedSync, kNeedSyncHostToDevice, kNeedSyncDeviceToHos | |||
| // A sub namespace in ME to support tensor related definition. | |||
| namespace tensor { | |||
| // Tensor data interface. | |||
| class TensorData { | |||
| class MS_CORE_API TensorData { | |||
| public: | |||
| /// virtual destructor is required for base classes. | |||
| virtual ~TensorData() = default; | |||
| @@ -111,7 +111,7 @@ class WaitEvent : public ExceptionListener { | |||
| }; | |||
| // Tensor entity class | |||
| class Tensor : public MetaTensor { | |||
| class MS_CORE_API Tensor : public MetaTensor { | |||
| public: | |||
| abstract::AbstractBasePtr ToAbstract() override; | |||
| @@ -34,7 +34,7 @@ | |||
| #include "utils/ms_utils.h" | |||
| namespace mindspore { | |||
| class ValueSequeue : public Value { | |||
| class MS_CORE_API ValueSequeue : public Value { | |||
| public: | |||
| explicit ValueSequeue(const ValuePtrList &elements) : elements_(elements) { | |||
| TypePtrList t_list; | |||
| @@ -69,7 +69,7 @@ class ValueSequeue : public Value { | |||
| }; | |||
| using ValueSequeuePtr = std::shared_ptr<ValueSequeue>; | |||
| class ValueTuple : public ValueSequeue { | |||
| class MS_CORE_API ValueTuple : public ValueSequeue { | |||
| public: | |||
| explicit ValueTuple(const std::vector<ValuePtr> &elements) : ValueSequeue(elements) {} | |||
| ValueTuple(const std::initializer_list<ValuePtr> &elements) : ValueSequeue(elements) {} | |||
| @@ -82,7 +82,7 @@ class ValueTuple : public ValueSequeue { | |||
| }; | |||
| using ValueTuplePtr = std::shared_ptr<ValueTuple>; | |||
| class ValueList : public ValueSequeue { | |||
| class MS_CORE_API ValueList : public ValueSequeue { | |||
| public: | |||
| explicit ValueList(const std::vector<ValuePtr> &elements) : ValueSequeue(elements) {} | |||
| ValueList(const std::initializer_list<ValuePtr> &elements) : ValueSequeue(elements) {} | |||
| @@ -110,7 +110,7 @@ ValuePtr MakeValue(const T &vec) { | |||
| return std::make_shared<ValueTuple>(list); | |||
| } | |||
| class ValueSlice : public Value { | |||
| class MS_CORE_API ValueSlice : public Value { | |||
| public: | |||
| ValueSlice(const ValuePtr &start, const ValuePtr &stop, const ValuePtr &step) | |||
| : start_(start), stop_(stop), step_(step) {} | |||
| @@ -135,7 +135,7 @@ class ValueSlice : public Value { | |||
| }; | |||
| using ValueSlicePtr = std::shared_ptr<ValueSlice>; | |||
| class KeywordArg : public Value { | |||
| class MS_CORE_API KeywordArg : public Value { | |||
| public: | |||
| KeywordArg(const std::string &key, const ValuePtr &value) : key_(key), value_(value) {} | |||
| ~KeywordArg() override = default; | |||
| @@ -156,7 +156,7 @@ class KeywordArg : public Value { | |||
| }; | |||
| using KeywordArgPtr = std::shared_ptr<KeywordArg>; | |||
| class ValueDictionary : public Value { | |||
| class MS_CORE_API ValueDictionary : public Value { | |||
| public: | |||
| explicit ValueDictionary(const std::vector<std::pair<std::string, ValuePtr>> &key_values) : key_values_(key_values) {} | |||
| ~ValueDictionary() override = default; | |||
| @@ -197,7 +197,7 @@ class ValueDictionary : public Value { | |||
| }; | |||
| using ValueDictionaryPtr = std::shared_ptr<ValueDictionary>; | |||
| class StringImm : public Value { | |||
| class MS_CORE_API StringImm : public Value { | |||
| public: | |||
| explicit StringImm(const std::string &str) : Value(kString), str_(str), hash_(std::hash<std::string>{}(str_)) {} | |||
| @@ -224,7 +224,7 @@ using StringImmPtr = std::shared_ptr<StringImm>; | |||
| IMM_TRAITS(StringImmPtr, std::string) | |||
| IMM_TRAITS(StringImmPtr, const char *) | |||
| class RefKey : public Named { | |||
| class MS_CORE_API RefKey : public Named { | |||
| public: | |||
| explicit RefKey(const std::string &tag) : Named(tag) {} | |||
| @@ -242,7 +242,7 @@ class RefKey : public Named { | |||
| }; | |||
| using RefKeyPtr = std::shared_ptr<RefKey>; | |||
| class AnyValue : public Value { | |||
| class MS_CORE_API AnyValue : public Value { | |||
| public: | |||
| AnyValue() = default; | |||
| ~AnyValue() override = default; | |||
| @@ -253,7 +253,7 @@ class AnyValue : public Value { | |||
| }; | |||
| extern const ValuePtr kAnyValue; | |||
| class Monad : public Value { | |||
| class MS_CORE_API Monad : public Value { | |||
| public: | |||
| ~Monad() override = default; | |||
| MS_DECLARE_PARENT(Monad, Value) | |||
| @@ -263,7 +263,7 @@ class Monad : public Value { | |||
| explicit Monad(TypePtr type) : Value(type) {} | |||
| }; | |||
| class UMonad : public Monad { | |||
| class MS_CORE_API UMonad : public Monad { | |||
| public: | |||
| UMonad() : Monad(kUMonadType) {} | |||
| ~UMonad() override = default; | |||
| @@ -276,7 +276,7 @@ class UMonad : public Monad { | |||
| using UMonadPtr = std::shared_ptr<UMonad>; | |||
| extern const ValuePtr kUMonad; | |||
| class IOMonad : public Monad { | |||
| class MS_CORE_API IOMonad : public Monad { | |||
| public: | |||
| IOMonad() : Monad(kIOMonadType) {} | |||
| ~IOMonad() override = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class LayerNormBetaGammaBackprop : public PrimitiveC { | |||
| class MS_CORE_API LayerNormBetaGammaBackprop : public PrimitiveC { | |||
| public: | |||
| LayerNormBetaGammaBackprop() : PrimitiveC(prim::kPrimLayerNormBetaGammaBackprop->name()) {} | |||
| ~LayerNormBetaGammaBackprop() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class LayerNormXBackprop : public PrimitiveC { | |||
| class MS_CORE_API LayerNormXBackprop : public PrimitiveC { | |||
| public: | |||
| LayerNormXBackprop() : PrimitiveC(prim::kPrimLayerNormXBackprop->name()) {} | |||
| ~LayerNormXBackprop() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAbs = "Abs"; | |||
| class Abs : public PrimitiveC { | |||
| class MS_CORE_API Abs : public PrimitiveC { | |||
| public: | |||
| Abs() : PrimitiveC(kNameAbs) { InitIOName({"input_x"}, {"output"}); } | |||
| ~Abs() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAdam = "Adam"; | |||
| class Adam : public PrimitiveC { | |||
| class MS_CORE_API Adam : public PrimitiveC { | |||
| public: | |||
| Adam() : PrimitiveC(kNameAdam) {} | |||
| ~Adam() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAdd = prim::kAdd; | |||
| class Add : public PrimitiveC { | |||
| class MS_CORE_API Add : public PrimitiveC { | |||
| public: | |||
| Add() : PrimitiveC(kNameAdd) { InitIOName({"x", "y"}, {"output"}); } | |||
| explicit Add(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAdder = "Adder"; | |||
| class Adder : public PrimitiveC { | |||
| class MS_CORE_API Adder : public PrimitiveC { | |||
| public: | |||
| explicit Adder(const std::string &k_name = kNameAdder) : PrimitiveC(k_name) {} | |||
| ~Adder() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAddN = "AddN"; | |||
| class AddN : public PrimitiveC { | |||
| class MS_CORE_API AddN : public PrimitiveC { | |||
| public: | |||
| AddN() : PrimitiveC(kNameAddN) { InitIOName({"inputs"}, {"sum"}); } | |||
| ~AddN() = default; | |||
| @@ -29,7 +29,7 @@ constexpr auto kNameAffine = "Affine"; | |||
| constexpr auto kAffineContext = "context"; | |||
| constexpr auto kAffineOutputDim = "output_dim"; | |||
| class Affine : public PrimitiveC { | |||
| class MS_CORE_API Affine : public PrimitiveC { | |||
| public: | |||
| Affine() : PrimitiveC(kNameAffine) { InitIOName({"x1", "x2"}, {"outputs"}); } | |||
| ~Affine() = default; | |||
| @@ -23,7 +23,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAll = "All"; | |||
| class All : public PrimitiveC { | |||
| class MS_CORE_API All : public PrimitiveC { | |||
| public: | |||
| All() : PrimitiveC(kNameAll) {} | |||
| ~All() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameApplyMomentum = "ApplyMomentum"; | |||
| class ApplyMomentum : public PrimitiveC { | |||
| class MS_CORE_API ApplyMomentum : public PrimitiveC { | |||
| public: | |||
| ApplyMomentum() : PrimitiveC(kNameApplyMomentum) { | |||
| InitIOName({"variable", "accumulation", "learning_rate", "gradient", "momentum"}, {"output"}); | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameArgMax = "Argmax"; | |||
| class ArgMax : public PrimitiveC { | |||
| class MS_CORE_API ArgMax : public PrimitiveC { | |||
| public: | |||
| ArgMax() : PrimitiveC(kNameArgMax) { InitIOName({"x"}, {"output"}); } | |||
| explicit ArgMax(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameArgMin = "ArgMin"; | |||
| class ArgMin : public PrimitiveC { | |||
| class MS_CORE_API ArgMin : public PrimitiveC { | |||
| public: | |||
| ArgMin() : PrimitiveC(kNameArgMin) { InitIOName({"x"}, {"output"}); } | |||
| explicit ArgMin(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAsin = "Asin"; | |||
| class Asin : public PrimitiveC { | |||
| class MS_CORE_API Asin : public PrimitiveC { | |||
| public: | |||
| Asin() : PrimitiveC(kNameAsin) {} | |||
| ~Asin() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAssert = "Assert"; | |||
| class Assert : public PrimitiveC { | |||
| class MS_CORE_API Assert : public PrimitiveC { | |||
| public: | |||
| Assert() : PrimitiveC(kNameAssert) {} | |||
| ~Assert() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAssign = "Assign"; | |||
| class Assign : public PrimitiveC { | |||
| class MS_CORE_API Assign : public PrimitiveC { | |||
| public: | |||
| Assign() : PrimitiveC(kNameAssign) { InitIOName({"ref", "value"}, {"output"}); } | |||
| ~Assign() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAssignAdd = "AssignAdd"; | |||
| class AssignAdd : public PrimitiveC { | |||
| class MS_CORE_API AssignAdd : public PrimitiveC { | |||
| public: | |||
| AssignAdd() : PrimitiveC(kNameAssignAdd) { InitIOName({"ref", "value"}, {"output"}); } | |||
| ~AssignAdd() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAtan = "Atan"; | |||
| class Atan : public PrimitiveC { | |||
| class MS_CORE_API Atan : public PrimitiveC { | |||
| public: | |||
| Atan() : PrimitiveC(kNameAtan) {} | |||
| ~Atan() = default; | |||
| @@ -27,7 +27,7 @@ namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAttention = "Attention"; | |||
| // Attention MultiHeadAttention | |||
| class Attention : public PrimitiveC { | |||
| class MS_CORE_API Attention : public PrimitiveC { | |||
| public: | |||
| Attention() : PrimitiveC(kNameAttention) { | |||
| InitIOName( | |||
| @@ -29,7 +29,7 @@ namespace ops { | |||
| constexpr auto kNameAudioSpectrogram = "AudioSpectrogram"; | |||
| int64_t Log2Ceil(int64_t length); | |||
| int64_t GetFftLength(int64_t length); | |||
| class AudioSpectrogram : public PrimitiveC { | |||
| class MS_CORE_API AudioSpectrogram : public PrimitiveC { | |||
| public: | |||
| AudioSpectrogram() : PrimitiveC(kNameAudioSpectrogram) {} | |||
| ~AudioSpectrogram() = default; | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameAvgPool = "AvgPool"; | |||
| class AvgPool : public PrimitiveC { | |||
| class MS_CORE_API AvgPool : public PrimitiveC { | |||
| public: | |||
| AvgPool() : PrimitiveC(kNameAvgPool) { InitIOName({"x"}, {"output"}); } | |||
| explicit AvgPool(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class AvgPool3D : public PrimitiveC { | |||
| class MS_CORE_API AvgPool3D : public PrimitiveC { | |||
| public: | |||
| AvgPool3D() : PrimitiveC(prim::kPrimAvgPool3D->name()) { InitIOName({"input"}, {"output"}); } | |||
| ~AvgPool3D() = default; | |||
| @@ -24,7 +24,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class BatchMatmul : public PrimitiveC { | |||
| class MS_CORE_API BatchMatmul : public PrimitiveC { | |||
| public: | |||
| BatchMatmul() : PrimitiveC(prim::kPrimBatchMatMul->name()) { InitIOName({"x1", "x2"}, {"output"}); } | |||
| ~BatchMatmul() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameBatchNorm = "BatchNorm"; | |||
| class BatchNorm : public PrimitiveC { | |||
| class MS_CORE_API BatchNorm : public PrimitiveC { | |||
| public: | |||
| BatchNorm() : PrimitiveC(kNameBatchNorm) { | |||
| InitIOName({"x", "scale", "offset", "mean", "variance"}, | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameBatchToSpace = "BatchToSpace"; | |||
| class BatchToSpace : public PrimitiveC { | |||
| class MS_CORE_API BatchToSpace : public PrimitiveC { | |||
| public: | |||
| BatchToSpace() : PrimitiveC(kNameBatchToSpace) {} | |||
| ~BatchToSpace() = default; | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameBatchToSpaceND = "BatchToSpaceND"; | |||
| class BatchToSpaceND : public PrimitiveC { | |||
| class MS_CORE_API BatchToSpaceND : public PrimitiveC { | |||
| public: | |||
| BatchToSpaceND() : PrimitiveC(kNameBatchToSpaceND) {} | |||
| ~BatchToSpaceND() = default; | |||
| @@ -29,7 +29,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameBiasAdd = prim::kBiasAdd; | |||
| class BiasAdd : public PrimitiveC { | |||
| class MS_CORE_API BiasAdd : public PrimitiveC { | |||
| public: | |||
| BiasAdd() : PrimitiveC(prim::kPrimBiasAdd->name()) { InitIOName({"x", "b"}, {"output"}); } | |||
| ~BiasAdd() = default; | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameBinaryCrossEntropy = "BinaryCrossEntropy"; | |||
| class BinaryCrossEntropy : public PrimitiveC { | |||
| class MS_CORE_API BinaryCrossEntropy : public PrimitiveC { | |||
| public: | |||
| BinaryCrossEntropy() : PrimitiveC(kNameBinaryCrossEntropy) {} | |||
| ~BinaryCrossEntropy() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameBroadcast = "Broadcast"; | |||
| class Broadcast : public PrimitiveC { | |||
| class MS_CORE_API Broadcast : public PrimitiveC { | |||
| public: | |||
| Broadcast() : PrimitiveC(kNameBroadcast) {} | |||
| ~Broadcast() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class BroadcastTo : public PrimitiveC { | |||
| class MS_CORE_API BroadcastTo : public PrimitiveC { | |||
| public: | |||
| BroadcastTo() : PrimitiveC(prim::kPrimBroadcastTo->name()) {} | |||
| ~BroadcastTo() = default; | |||
| @@ -23,7 +23,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCall = "call"; | |||
| class Call : public PrimitiveC { | |||
| class MS_CORE_API Call : public PrimitiveC { | |||
| public: | |||
| Call() : PrimitiveC(kNameCall) {} | |||
| ~Call() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCast = "Cast"; | |||
| class Cast : public PrimitiveC { | |||
| class MS_CORE_API Cast : public PrimitiveC { | |||
| public: | |||
| Cast() : PrimitiveC(kNameCast) { InitIOName({"x", "dst_type"}, {"output"}); } | |||
| ~Cast() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCeil = "Ceil"; | |||
| class Ceil : public PrimitiveC { | |||
| class MS_CORE_API Ceil : public PrimitiveC { | |||
| public: | |||
| Ceil() : PrimitiveC(kNameCeil) { InitIOName({"x"}, {"y"}); } | |||
| ~Ceil() = default; | |||
| @@ -24,7 +24,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameClip = "Clip"; | |||
| class Clip : public PrimitiveC { | |||
| class MS_CORE_API Clip : public PrimitiveC { | |||
| public: | |||
| Clip() : PrimitiveC(kNameClip) {} | |||
| ~Clip() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameConcat = "Concat"; | |||
| class Concat : public PrimitiveC { | |||
| class MS_CORE_API Concat : public PrimitiveC { | |||
| public: | |||
| Concat() : PrimitiveC(kNameConcat) {} | |||
| ~Concat() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameConstantOfShape = "ConstantOfShape"; | |||
| class ConstantOfShape : public PrimitiveC { | |||
| class MS_CORE_API ConstantOfShape : public PrimitiveC { | |||
| public: | |||
| ConstantOfShape() : PrimitiveC(kNameConstantOfShape) {} | |||
| ~ConstantOfShape() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameControlDepend = "ControlDepend"; | |||
| class ControlDepend : public PrimitiveC { | |||
| class MS_CORE_API ControlDepend : public PrimitiveC { | |||
| public: | |||
| ControlDepend() : PrimitiveC(kNameControlDepend) {} | |||
| ~ControlDepend() = default; | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameConv2D = "Conv2D"; | |||
| class Conv2D : public PrimitiveC { | |||
| class MS_CORE_API Conv2D : public PrimitiveC { | |||
| public: | |||
| Conv2D() : PrimitiveC(kNameConv2D) { InitIOName({"x", "w"}, {"output"}); } | |||
| explicit Conv2D(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "w"}, {"output"}); } | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameConv2DTranspose = "Conv2DTranspose"; | |||
| class Conv2DTranspose : public PrimitiveC { | |||
| class MS_CORE_API Conv2DTranspose : public PrimitiveC { | |||
| public: | |||
| Conv2DTranspose() : PrimitiveC(kNameConv2DTranspose) { | |||
| InitIOName({"out_backprop", "filter", "input_sizes"}, {"output"}); | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCos = "Cos"; | |||
| class Cos : public PrimitiveC { | |||
| class MS_CORE_API Cos : public PrimitiveC { | |||
| public: | |||
| Cos() : PrimitiveC(kNameCos) {} | |||
| ~Cos() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCrop = "Crop"; | |||
| class Crop : public PrimitiveC { | |||
| class MS_CORE_API Crop : public PrimitiveC { | |||
| public: | |||
| Crop() : PrimitiveC(kNameCrop) {} | |||
| ~Crop() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCropAndResize = "CropAndResize"; | |||
| class CropAndResize : public PrimitiveC { | |||
| class MS_CORE_API CropAndResize : public PrimitiveC { | |||
| public: | |||
| CropAndResize() : PrimitiveC(kNameCropAndResize) { InitIOName({"x", "boxes", "box_index", "crop_size"}, {"y"}); } | |||
| ~CropAndResize() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCTCLossV2 = "CTCLossV2"; | |||
| class CTCLossV2 : public PrimitiveC { | |||
| class MS_CORE_API CTCLossV2 : public PrimitiveC { | |||
| public: | |||
| CTCLossV2() : PrimitiveC(kNameCTCLossV2) { | |||
| InitIOName({"log_probs", "targets", "input_lengths", "target_lengths"}, {"neg_log_likelihood", "log_alpha"}); | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCTCLossV2Grad = "CTCLossV2Grad"; | |||
| class CTCLossV2Grad : public PrimitiveC { | |||
| class MS_CORE_API CTCLossV2Grad : public PrimitiveC { | |||
| public: | |||
| CTCLossV2Grad() : PrimitiveC(kNameCTCLossV2Grad) { | |||
| InitIOName( | |||
| @@ -24,7 +24,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class CTCLoss : public PrimitiveC { | |||
| class MS_CORE_API CTCLoss : public PrimitiveC { | |||
| public: | |||
| CTCLoss() : PrimitiveC(prim::kPrimCTCLoss->name()) {} | |||
| ~CTCLoss() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCumSum = "CumSum"; | |||
| class CumSum : public PrimitiveC { | |||
| class MS_CORE_API CumSum : public PrimitiveC { | |||
| public: | |||
| CumSum() : PrimitiveC(kNameCumSum) {} | |||
| ~CumSum() = default; | |||
| @@ -29,7 +29,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCustom = "Custom"; | |||
| class Custom : public PrimitiveC { | |||
| class MS_CORE_API Custom : public PrimitiveC { | |||
| public: | |||
| Custom() : PrimitiveC(kNameCustom) {} | |||
| ~Custom() override = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCustomExtractFeatures = "CustomExtractFeatures"; | |||
| class CustomExtractFeatures : public PrimitiveC { | |||
| class MS_CORE_API CustomExtractFeatures : public PrimitiveC { | |||
| public: | |||
| CustomExtractFeatures() : PrimitiveC(kNameCustomExtractFeatures) {} | |||
| ~CustomExtractFeatures() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCustomNormalize = "CustomNormalize"; | |||
| class CustomNormalize : public PrimitiveC { | |||
| class MS_CORE_API CustomNormalize : public PrimitiveC { | |||
| public: | |||
| CustomNormalize() : PrimitiveC(kNameCustomNormalize) {} | |||
| ~CustomNormalize() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameCustomPredict = "CustomPredict"; | |||
| class CustomPredict : public PrimitiveC { | |||
| class MS_CORE_API CustomPredict : public PrimitiveC { | |||
| public: | |||
| CustomPredict() : PrimitiveC(kNameCustomPredict) {} | |||
| ~CustomPredict() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameDepend = "Depend"; | |||
| class Depend : public PrimitiveC { | |||
| class MS_CORE_API Depend : public PrimitiveC { | |||
| public: | |||
| Depend() : PrimitiveC(kNameDepend) {} | |||
| ~Depend() = default; | |||
| @@ -28,7 +28,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameDepthToSpace = "DepthToSpace"; | |||
| class DepthToSpace : public PrimitiveC { | |||
| class MS_CORE_API DepthToSpace : public PrimitiveC { | |||
| public: | |||
| DepthToSpace() : PrimitiveC(kNameDepthToSpace) { InitIOName({"x"}, {"y"}); } | |||
| ~DepthToSpace() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameDetectionPostProcess = "DetectionPostProcess"; | |||
| class DetectionPostProcess : public PrimitiveC { | |||
| class MS_CORE_API DetectionPostProcess : public PrimitiveC { | |||
| public: | |||
| DetectionPostProcess() : PrimitiveC(kNameDetectionPostProcess) {} | |||
| ~DetectionPostProcess() = default; | |||
| @@ -24,7 +24,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class Diag : public PrimitiveC { | |||
| class MS_CORE_API Diag : public PrimitiveC { | |||
| public: | |||
| Diag() : PrimitiveC(prim::kPrimDiag->name()) { InitIOName({"input_x"}, {"output"}); } | |||
| ~Diag() = default; | |||
| @@ -24,7 +24,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class DiagPart : public PrimitiveC { | |||
| class MS_CORE_API DiagPart : public PrimitiveC { | |||
| public: | |||
| DiagPart() : PrimitiveC(prim::kPrimDiagPart->name()) { InitIOName({"input_x"}, {"output"}); } | |||
| ~DiagPart() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameDiv = "Div"; | |||
| class Div : public PrimitiveC { | |||
| class MS_CORE_API Div : public PrimitiveC { | |||
| public: | |||
| Div() : PrimitiveC(kNameDiv) { InitIOName({"x", "y"}, {"output"}); } | |||
| explicit Div(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameDropout = "Dropout"; | |||
| class Dropout : public PrimitiveC { | |||
| class MS_CORE_API Dropout : public PrimitiveC { | |||
| public: | |||
| Dropout() : PrimitiveC(kNameDropout) {} | |||
| ~Dropout() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class DropoutDoMask : public PrimitiveC { | |||
| class MS_CORE_API DropoutDoMask : public PrimitiveC { | |||
| public: | |||
| DropoutDoMask() : PrimitiveC(prim::kPrimDropoutDoMask->name()) {} | |||
| ~DropoutDoMask() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class DropoutGenMask : public PrimitiveC { | |||
| class MS_CORE_API DropoutGenMask : public PrimitiveC { | |||
| public: | |||
| DropoutGenMask() : PrimitiveC(prim::kPrimDropoutGenMask->name()) {} | |||
| ~DropoutGenMask() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class DType : public PrimitiveC { | |||
| class MS_CORE_API DType : public PrimitiveC { | |||
| public: | |||
| DType() : PrimitiveC(prim::kPrimDType->name()) { InitIOName({"x"}, {"output"}); } | |||
| ~DType() = default; | |||
| @@ -23,7 +23,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| class DynamicBroadcastGradientArgs : public PrimitiveC { | |||
| class MS_CORE_API DynamicBroadcastGradientArgs : public PrimitiveC { | |||
| public: | |||
| DynamicBroadcastGradientArgs() : PrimitiveC(prim::kPrimDynamicBroadcastGradientArgs->name()) {} | |||
| ~DynamicBroadcastGradientArgs() = default; | |||
| @@ -23,7 +23,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameEltwise = "Eltwise"; | |||
| class Eltwise : public PrimitiveC { | |||
| class MS_CORE_API Eltwise : public PrimitiveC { | |||
| public: | |||
| Eltwise() : PrimitiveC(kNameEltwise) {} | |||
| ~Eltwise() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameElu = "Elu"; | |||
| class Elu : public PrimitiveC { | |||
| class MS_CORE_API Elu : public PrimitiveC { | |||
| public: | |||
| Elu() : PrimitiveC(kNameElu) {} | |||
| ~Elu() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameEmbeddingLookup = "EmbeddingLookup"; | |||
| class EmbeddingLookup : public PrimitiveC { | |||
| class MS_CORE_API EmbeddingLookup : public PrimitiveC { | |||
| public: | |||
| EmbeddingLookup() : PrimitiveC(kNameEmbeddingLookup) { InitIOName({"params", "indices", "offset"}, {"output"}); } | |||
| ~EmbeddingLookup() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameEqual = prim::kEqual; | |||
| class Equal : public PrimitiveC { | |||
| class MS_CORE_API Equal : public PrimitiveC { | |||
| public: | |||
| Equal() : PrimitiveC(prim::kPrimEqual->name()) { InitIOName({"x", "y"}, {"output"}); } | |||
| ~Equal() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameErf = "Erf"; | |||
| class Erf : public PrimitiveC { | |||
| class MS_CORE_API Erf : public PrimitiveC { | |||
| public: | |||
| Erf() : PrimitiveC(kNameErf) { InitIOName({"x"}, {"y"}); } | |||
| ~Erf() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameExp = prim::kExp; | |||
| class Exp : public PrimitiveC { | |||
| class MS_CORE_API Exp : public PrimitiveC { | |||
| public: | |||
| Exp() : PrimitiveC(prim::kPrimExp->name()) { InitIOName({"x"}, {"y"}); } | |||
| explicit Exp(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"y"}); } | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameExpandDims = "ExpandDims"; | |||
| class ExpandDims : public PrimitiveC { | |||
| class MS_CORE_API ExpandDims : public PrimitiveC { | |||
| public: | |||
| ExpandDims() : PrimitiveC(kNameExpandDims) { InitIOName({"x", "axis"}, {"output"}); } | |||
| ~ExpandDims() = default; | |||
| @@ -25,7 +25,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFakeQuantWithMinMaxVars = "FakeQuantWithMinMaxVars"; | |||
| class FakeQuantWithMinMaxVars : public PrimitiveC { | |||
| class MS_CORE_API FakeQuantWithMinMaxVars : public PrimitiveC { | |||
| public: | |||
| FakeQuantWithMinMaxVars() : PrimitiveC(kNameFakeQuantWithMinMaxVars) {} | |||
| ~FakeQuantWithMinMaxVars() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFakeQuantWithMinMaxVarsPerChannel = "FakeQuantWithMinMaxVarsPerChannel"; | |||
| class FakeQuantWithMinMaxVarsPerChannel : public PrimitiveC { | |||
| class MS_CORE_API FakeQuantWithMinMaxVarsPerChannel : public PrimitiveC { | |||
| public: | |||
| FakeQuantWithMinMaxVarsPerChannel() : PrimitiveC(kNameFakeQuantWithMinMaxVarsPerChannel) {} | |||
| ~FakeQuantWithMinMaxVarsPerChannel() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFftImag = "FftImag"; | |||
| class FftImag : public PrimitiveC { | |||
| class MS_CORE_API FftImag : public PrimitiveC { | |||
| public: | |||
| FftImag() : PrimitiveC(kNameFftImag) {} | |||
| ~FftImag() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFftReal = "FftReal"; | |||
| class FftReal : public PrimitiveC { | |||
| class MS_CORE_API FftReal : public PrimitiveC { | |||
| public: | |||
| FftReal() : PrimitiveC(kNameFftReal) {} | |||
| ~FftReal() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFill = "Fill"; | |||
| class Fill : public PrimitiveC { | |||
| class MS_CORE_API Fill : public PrimitiveC { | |||
| public: | |||
| Fill() : PrimitiveC(kNameFill) {} | |||
| ~Fill() = default; | |||
| @@ -26,7 +26,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFlatten = "Flatten"; | |||
| class Flatten : public PrimitiveC { | |||
| class MS_CORE_API Flatten : public PrimitiveC { | |||
| public: | |||
| Flatten() : PrimitiveC(kNameFlatten) {} | |||
| ~Flatten() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFloor = "Floor"; | |||
| class Floor : public PrimitiveC { | |||
| class MS_CORE_API Floor : public PrimitiveC { | |||
| public: | |||
| Floor() : PrimitiveC(kNameFloor) { InitIOName({"x"}, {"y"}); } | |||
| ~Floor() = default; | |||
| @@ -23,7 +23,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFloorDiv = "FloorDiv"; | |||
| class FloorDiv : public PrimitiveC { | |||
| class MS_CORE_API FloorDiv : public PrimitiveC { | |||
| public: | |||
| FloorDiv() : PrimitiveC(kNameFloorDiv) { InitIOName({"x", "y"}, {"output"}); } | |||
| ~FloorDiv() = default; | |||
| @@ -23,7 +23,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFloorMod = "FloorMod"; | |||
| class FloorMod : public PrimitiveC { | |||
| class MS_CORE_API FloorMod : public PrimitiveC { | |||
| public: | |||
| FloorMod() : PrimitiveC(kNameFloorMod) { InitIOName({"x", "y"}, {"output"}); } | |||
| ~FloorMod() = default; | |||
| @@ -27,7 +27,7 @@ | |||
| namespace mindspore { | |||
| namespace ops { | |||
| constexpr auto kNameFusedBatchNorm = "FusedBatchNorm"; | |||
| class FusedBatchNorm : public PrimitiveC { | |||
| class MS_CORE_API FusedBatchNorm : public PrimitiveC { | |||
| public: | |||
| FusedBatchNorm() : PrimitiveC(kNameFusedBatchNorm) { | |||
| InitIOName({"x", "scale", "b", "mean", "variance"}, | |||