Commit e8ae6127 authored by peng.xu's avatar peng.xu
Browse files

Merge branch 'branch-0.5.0' into 'branch-0.5.0'

format code by clang-tidy

See merge request megasearch/milvus!638

Former-commit-id: a4584c5b060fcce62e5bac4485f6bc4173add312
parents 464a3415 aabd91a1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,3 +23,5 @@ AccessModifierOffset: -3
AlwaysBreakAfterReturnType: All
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AlignTrailingComments: true
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class YamlConfigMgr : public ConfigMgr {
    SetConfigValue(const YAML::Node& node, const std::string& key, ConfigNode& config);

    bool
    SetChildConfig(const YAML::Node& node, const std::string& name, ConfigNode& config);
    SetChildConfig(const YAML::Node& node, const std::string& child_name, ConfigNode& config);

    bool
    SetSequence(const YAML::Node& node, const std::string& child_name, ConfigNode& config);
+4 −2
Original line number Diff line number Diff line
@@ -46,12 +46,14 @@ struct Cfg {
        const int64_t &k,
        const int64_t &gpu_id,
        METRICTYPE type)
        : d(dim), k(k), gpu_id(gpu_id), metric_type(type) {}
        : metric_type(type), k(k), gpu_id(gpu_id), d(dim) {}

    Cfg() = default;

    virtual bool
    CheckValid(){};
    CheckValid(){
        return true;
    };
};
using Config = std::shared_ptr<Cfg>;

+2 −2
Original line number Diff line number Diff line
@@ -127,10 +127,10 @@ class Dataset {
    //}

 private:
    SchemaPtr array_schema_;
    SchemaPtr tensor_schema_;
    std::vector<ArrayPtr> array_;
    SchemaPtr array_schema_;
    std::vector<TensorPtr> tensor_;
    SchemaPtr tensor_schema_;
    //Config meta_;
};

+8 −3
Original line number Diff line number Diff line
@@ -25,9 +25,14 @@ namespace zilliz {
namespace knowhere {

faiss::MetricType GetMetricType(METRICTYPE &type) {
    if (type == METRICTYPE::L2) return faiss::METRIC_L2;
    if (type == METRICTYPE::IP) return faiss::METRIC_INNER_PRODUCT;
    if (type == METRICTYPE::INVALID) KNOWHERE_THROW_MSG("Metric type is invalid");
    if (type == METRICTYPE::L2) {
        return faiss::METRIC_L2;
    }
    if (type == METRICTYPE::IP) {
        return faiss::METRIC_INNER_PRODUCT;
    }

    KNOWHERE_THROW_MSG("Metric type is invalid");
}


Loading