Skip to content

Commit 7ece820

Browse files
authored
[LLGA] copy the quantizer_ when updating LlgaTensorDesc from a logical_tensor (#136)
* [LLGA] set quantizer after query from compilation * [LLGA] copy the quantizer_ when updating LlgaTensorDesc from a logical_tensor * fix clang format
1 parent 6a7bf57 commit 7ece820

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

torch_ipex/csrc/LlgaTensorImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ struct LlgaTensorDesc {
102102
return ret;
103103
}
104104

105+
LlgaTensorDesc update_desc(const desc &t) const {
106+
return LlgaTensorDesc(t).set_quantizer(quantizer_);
107+
}
108+
105109
QuantizerPtr get_quantizer() {
106110
return quantizer_;
107111
}

torch_ipex/csrc/jit/codegen/onednn/kernel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ compiled_partition LlgaKernel::compile(const partition &partition) {
172172
// we need to query them out from compilation and update outputSpecs
173173
for (size_t i = 0; i < nOutputs_; i++) {
174174
auto tid = outputSpecs_[i].tid();
175-
outputSpecs_[i] = compilation.query_logical_tensor(tid);
175+
outputSpecs_[i] =
176+
outputSpecs_[i].update_desc(compilation.query_logical_tensor(tid));
176177
}
177178

178179
// Build static mapping from output id to input offset

0 commit comments

Comments
 (0)