Home / Class/ FixedSizeStack Class — pytorch Architecture

FixedSizeStack Class — pytorch Architecture

Architecture documentation for the FixedSizeStack class in TunableOp.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/cuda/tunable/TunableOp.h lines 88–105

class FixedSizeStack {
  private:
      std::deque<std::string> stack;
      const size_t max_size;

  public:
      FixedSizeStack(size_t size) : max_size(size) {}

      void push(const std::string& value) {
          if (stack.size() >= max_size) {
              stack.pop_front(); // Remove the oldest entry
          }
          stack.push_back(value); // Add new entry
      }

      auto rbegin() { return stack.rbegin(); }
      auto rend() { return stack.rend(); }
};

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free