Skip to content

Commit e3f3330

Browse files
craymichaelfacebook-github-bot
authored andcommitted
Preserve template in InterpretableInputs (#1582)
Summary: Pull Request resolved: #1582 Preserve template in InterpretableInputs before replacing it with a formatting function. This allows original template strings to be fetched, if needed. Reviewed By: sarahtranfb Differential Revision: D76426755 fbshipit-source-id: 1d6a8e1d69c8c21dba4b171a1206d8ee45cbfdbc
1 parent 0f8ec77 commit e3f3330

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

captum/attr/_utils/interpretable_input.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ def __init__(
286286
self.n_features = n_features
287287
self.n_itp_features = n_itp_features
288288

289+
# preserve template before modification
290+
self.template = template
289291
if isinstance(template, str):
290292
template = template.format
291293
else:

0 commit comments

Comments
 (0)