Skip to content

Commit 96467d2

Browse files
committedMar 10, 2025
examples: purged tag and dt shortcuts
Some examples define 'tag' and 'df' shortcuts to improve code readability. This detail is misleading when looking at annotated examples code that only shows code snippets.
1 parent caabd53 commit 96467d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+634
-461
lines changed
 

‎examples/bnorm_u8_via_binary_postops.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2020-2022 Intel Corporation
2+
* Copyright 2020-2025 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,9 +46,6 @@
4646

4747
using namespace dnnl;
4848

49-
using tag = memory::format_tag;
50-
using dt = memory::data_type;
51-
5249
void bnorm_u8_via_binary_postops(dnnl::engine::kind engine_kind) {
5350

5451
// Create execution dnnl::engine.
@@ -102,12 +99,18 @@ void bnorm_u8_via_binary_postops(dnnl::engine::kind engine_kind) {
10299
oscale_data.begin(), oscale_data.end(), []() { return 0.5f; });
103100

104101
// Create descriptors.
105-
auto src_md = memory::desc(src_dims, dt::u8, tag::nhwc);
106-
auto mean_md = memory::desc(params_dims, dt::f32, tag::nhwc);
107-
auto variance_md = memory::desc(params_dims, dt::f32, tag::nhwc);
108-
auto scale_md = memory::desc(params_dims, dt::f32, tag::nhwc);
109-
auto shift_md = memory::desc(params_dims, dt::f32, tag::nhwc);
110-
auto oscale_md = memory::desc(params_dims, dt::f32, tag::nhwc);
102+
auto src_md = memory::desc(
103+
src_dims, memory::data_type::u8, memory::format_tag::nhwc);
104+
auto mean_md = memory::desc(
105+
params_dims, memory::data_type::f32, memory::format_tag::nhwc);
106+
auto variance_md = memory::desc(
107+
params_dims, memory::data_type::f32, memory::format_tag::nhwc);
108+
auto scale_md = memory::desc(
109+
params_dims, memory::data_type::f32, memory::format_tag::nhwc);
110+
auto shift_md = memory::desc(
111+
params_dims, memory::data_type::f32, memory::format_tag::nhwc);
112+
auto oscale_md = memory::desc(
113+
params_dims, memory::data_type::f32, memory::format_tag::nhwc);
111114

112115
// Create src memory objects.
113116
auto src_mem = memory(src_md, engine);

‎examples/cnn_inference_f32.cpp

+121-62
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)