Skip to content

Commit

Permalink
Tensor registration tensorid increment bug fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroarmas committed May 18, 2022
1 parent a0f6b99 commit a1c7047
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions computational_graph_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace NeuralNetwork {

namespace Graph {

TensorID ComputationalGraphMap::tensor_id = TensorID(0);


FunctionObject ComputationalGraphMap::_get_operation(TensorID my_tensor_id) noexcept {
// u_int16_t my_tensor_id = _t->get_tensor_id();
Expand Down
11 changes: 6 additions & 5 deletions include/computational_graph_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace NeuralNetwork {
*/
class ComputationalGraphMap {


public:
static ComputationalGraphMap& get(){
static ComputationalGraphMap map;
Expand All @@ -48,18 +49,18 @@ namespace NeuralNetwork {


protected:
constexpr static uint16_t ENTRIES = 2000;
ComputationalGraphMap() :
op_registry(2000),
tensor_registry(2000),
recovered_tensor_id(),
tensor_id(0) {}
op_registry(ENTRIES),
tensor_registry(ENTRIES),
recovered_tensor_id() {}


private:
std::vector<FunctionObject> op_registry;
std::vector<std::shared_ptr<Tensor>> tensor_registry;
std::stack<TensorID> recovered_tensor_id;
TensorID tensor_id;
static TensorID tensor_id;


};
Expand Down

0 comments on commit a1c7047

Please sign in to comment.