113 lines
2.7 KiB
Plaintext
113 lines
2.7 KiB
Plaintext
@startuml
|
|
set namespaceSeparator ::
|
|
|
|
namespace dynasty {
|
|
|
|
namespace inferencer {
|
|
|
|
abstract class AbstractInferencer<T> {
|
|
+ {abstract} Inference(unordered_map<string, vector<T>>) : unordered_map<string, vector<T>>
|
|
+ {abstract} Inference(unordered_map<string, string>) : unordered_map<string, vector<T>>
|
|
+ Inference(string) : unordered_map<string, vector<T>>
|
|
# {abstract} CleanUp() : void
|
|
}
|
|
|
|
|
|
class InferencerDeletor {
|
|
+ operator () (AbstractInferencer<T> *ptr) : void
|
|
}
|
|
|
|
AbstractInferencer +-- InferencerDeletor
|
|
|
|
note "ptr->CleanUp();delete ptr" as DeletorNote
|
|
|
|
DeletorNote .. InferencerDeletor
|
|
|
|
|
|
|
|
abstract class Builder {
|
|
+ {abstract} build() : unique_ptr<AbstractInferencer<T>, InferencerDeletor>
|
|
}
|
|
|
|
AbstractInferencer +-- Builder
|
|
|
|
|
|
namespace snpe {
|
|
class Inferencer<float> {
|
|
|
|
+ {static} GetBuilder() : std::unique_ptr<Builder>
|
|
|
|
}
|
|
|
|
class Builder {
|
|
+ build() : unique_ptr<AbstractInferencer<T>, InferencerDeletor>
|
|
|
|
+ WithModel(string const &) : Builder*
|
|
}
|
|
|
|
Inferencer +-- Builder
|
|
|
|
dynasty::inferencer::AbstractInferencer <|-- Inferencer
|
|
dynasty::inferencer::Builder <|-- Builder
|
|
|
|
} /'namespace snpe '/
|
|
|
|
|
|
namespace msft {
|
|
class Inferencer<float> {
|
|
+ {static} GetBuilder() : std::unique_ptr<Builder>
|
|
}
|
|
|
|
class Builder {
|
|
+ build() : unique_ptr<AbstractInferencer<T>, InferencerDeletor>
|
|
|
|
+ WithModel(string const &) : Builder*
|
|
+ WithGraphOptimization(uint32_t ) : Builder*
|
|
+ WithParallelLevel(uint32_t ) : Builder*
|
|
}
|
|
|
|
Inferencer +-- Builder
|
|
|
|
dynasty::inferencer::AbstractInferencer <|-- Inferencer
|
|
dynasty::inferencer::Builder <|-- Builder
|
|
|
|
} /'namespace msft '/
|
|
|
|
|
|
namespace common {
|
|
|
|
abstract class PianoInferencer<T> {
|
|
# shared_ptr<Graph const> graph_
|
|
|
|
# CheckInputCorrectness(unordered_map<string, vector<T>> const &preprocess_input) : bool
|
|
# {abstract} GraphBasedInference(unordered_map<string, vector<T>> const &preprocess_input) : unordered_map<string, vector<T>>
|
|
|
|
+ Inference(unordered_map<string, vector<T>>) : unordered_map<string, vector<T>>
|
|
+ Inference(unordered_map<string, string>) : unordered_map<string, vector<T>>
|
|
|
|
}
|
|
|
|
abstract class Builder {
|
|
+ {abstract} build() : unique_ptr<AbstractInferencer<T>, InferencerDeletor>
|
|
|
|
+ WithONNXModel(std::string const &onnx_file) : Builder *
|
|
+ WithBIEModel(std::string const &bie_file) : Builder *
|
|
+ WithGraphOptimization(uint32_t level) : Builder *
|
|
+ WithDeviceID(int device_id) : Builder *
|
|
|
|
+ GetGraph() const : shared_ptr<Graph const>
|
|
+ GetInputDimensions() : unordered_map<string, vector<uint32_t >>
|
|
+ GetOutputDimensions() : unordered_map<string, vector<uint32_t >>
|
|
}
|
|
|
|
dynasty::inferencer::AbstractInferencer <|-- PianoInferencer
|
|
dynasty::inferencer::Builder <|-- Builder
|
|
|
|
PianoInferencer +-- Builder
|
|
|
|
} /'namespace common '/
|
|
|
|
|
|
}
|
|
}
|
|
@enduml |