From 79c8ba2c36d9e088f4fb070c3dbb79903500a87b Mon Sep 17 00:00:00 2001 From: corlfj Date: Tue, 15 Apr 2025 14:31:53 +0800 Subject: [PATCH] lut, [-alpha,+alpha], dim is 2*alpha+1 --- python/mrt/sym_annotate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/mrt/sym_annotate.py b/python/mrt/sym_annotate.py index e35e6ff5..29e5414f 100644 --- a/python/mrt/sym_annotate.py +++ b/python/mrt/sym_annotate.py @@ -343,7 +343,7 @@ def _restore(): alpha = (2 ** (in_prec - 1)) - 1 data = nd.arange(-alpha, alpha+1) out = get_nd_op(op_name)(data / cscales[0]) - weight = (out * scales[name]).round().reshape(2*alpha, 1) + weight = (out * scales[name]).round().reshape(2*alpha+1, 1) W_name = name + '_weight' assert W_name not in graph W = graph[W_name] = mx.sym.var(W_name, shape=weight.shape) @@ -353,7 +353,7 @@ def _restore(): precs[alpha_name] = { out_key: in_prec } params[alpha_name] = nd.array([alpha]) X = mx.sym.broadcast_add(childs[0], alpha_sym) - node = mx.sym.Custom(X, W, in_dim=2*alpha, + node = mx.sym.Custom(X, W, in_dim=2*alpha+1, name=name, op_type='cvm_lut') scales[node.attr('name')] = scales[name] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy