Skip to content

Commit

Permalink
Remove long exceeded line, make alias.
Browse files Browse the repository at this point in the history
Remove long exceeded line, make alias.

ONE-DCO-1.0-Signed-off-by: Banseok Lee <[email protected]>
  • Loading branch information
BLee-bot committed Nov 1, 2024
1 parent 692fd84 commit dfc9584
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
namespace record_hessian
{
/**
* @brief Record approximated hessian matrix from GPTQ paper(https://arxiv.org/abs/2210.17323).
* @brief Record approximated hessian matrix from
* GPTQ paper(https://arxiv.org/abs/2210.17323).
*/
using HessianMap = std::unordered_map<const luci::CircleNode *, std::vector<float>>;
using HessianVectorMap = std::unordered_map<const luci::CircleNode *, HessianVector>;

class HessianComputer
{
Expand All @@ -38,7 +40,7 @@ class HessianComputer
std::unique_ptr<HessianMap> getMap();

private:
std::unordered_map<const luci::CircleNode *, HessianVector> _hessian_map;
HessianVectorMap _hessian_map;
const luci_interpreter::Tensor *_input_tensor = nullptr;

void recordHessianForConv2D(const luci::CircleNode *node);
Expand Down
3 changes: 2 additions & 1 deletion compiler/record-hessian/src/HessianComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ namespace record_hessian

/**
* @brief unfold the vector with NHWC shape, inherently acting in an in-place manner.
* @note (N, H, W, C) -> (N, L, H*W*C). See details(https://pytorch.org/docs/stable/generated/torch.nn.Unfold.html).
* @note (N, H, W, C) -> (N, L, H*W*C).
* See details(https://pytorch.org/docs/stable/generated/torch.nn.Unfold.html).
*/
void unfold(std::vector<float> &buf, uint32_t input_n, uint32_t input_h, uint32_t input_w,
uint32_t input_c, uint32_t stride_h, uint32_t stride_w, uint32_t dilation_h,
Expand Down

0 comments on commit dfc9584

Please sign in to comment.