Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Consistently apply MIT OR Apache-2.0 license and clarify licence on test files #150

Merged
merged 2 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2021 Xavier Tao, Tommy van der Vorst & WONNX contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
File renamed without changes.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,3 +434,27 @@ supported in the following cases:
Constant folding is performed as part of shape inference, unless disabled (from the CLI pass `--no-fold-constants` to disable). This
is done in order to support models that dynamically calculate shapes using operators such as `Shape`/`Squeeze`/`Unsqueeze` depending
on dynamically set dimension parameters (e.g. batch size).

## License

Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.

Except for the following files:

* `data/models`:
* `mobilenetv2-7.onnx`: [source](https://github.com/onnx/models/blob/main/vision/classification/mobilenet/model/mobilenetv2-7.onnx), Apache-2.0 license only.
* `squeezenet-labels.txt`: [source](https://github.com/onnx/models/blob/main/vision/classification/synset.txt), Apache-2.0 license only.

* `data/images`:
* `pelican.jpeg`: [source](https://en.wikipedia.org/wiki/Pelican#/media/File:Pelikan_Walvis_Bay.jpg), (C) Rui Ornelas, [CC-BY 2.0](https://creativecommons.org/licenses/by/2.0/).
* `bald_eagle.jpeg`: [source](https://en.wikipedia.org/wiki/Bald_eagle#/media/File:Bald-Eagle-9114-cropped.jpg), (C) David R. Tribble, [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)


### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you shall be dual licensed as above, without any
additional terms or conditions.
Binary file modified data/images/bald_eagle.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/images/italian_greyhound.jpeg
Binary file not shown.
Binary file modified data/images/pelican.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion wonnx-py/tests/test_onnx_backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT OR Apache-2.0

import itertools
import os
Expand Down
2 changes: 1 addition & 1 deletion wonnx-py/tests/test_specific_op.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT OR Apache-2.0
import onnx.backend.test

pytest_plugins = ("onnx.backend.test.report",)
Expand Down
37 changes: 0 additions & 37 deletions wonnx/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ lazy_static! {
include_str!("../templates/matrix/transpose.wgsl"),
)
.unwrap();
tera.add_raw_template(
"matrix/lrn.wgsl",
include_str!("../templates/matrix/lrn.wgsl"),
)
.unwrap();
tera.add_raw_template(
"pool/aggregate.wgsl",
include_str!("../templates/pool/aggregate.wgsl"),
Expand Down Expand Up @@ -1326,38 +1321,6 @@ pub fn compile(
threads: (ceil(output_lengths[0], 256) as _, 1, 1),
}
}
"LRN" => {
// https://github.com/onnx/onnx/blob/main/docs/Operators.md#lrn
let alpha = node.get_attribute_value("alpha", Some(0.0001))?;
let beta = node.get_attribute_value("beta", Some(0.75))?;
let bias = node.get_attribute_value("bias", Some(1.0))?;
let size = node.get_attribute_value("size", Some(1))?;

context.insert("alpha", &alpha);
context.insert("beta", &beta);
context.insert("bias", &bias);
context.insert("size", &size);

let left_size = f64::floor((size - 1) as f64 / 2.0) as u32;
let right_size = f64::ceil((size - 1) as f64 / 2.0) as u32;

context.insert("left_size", &left_size);
context.insert("right_size", &right_size);

let (x_threads, workgroup_size_x) = workgroup_size(
output_lengths[0],
MAX_COMPUTE_WORKGROUPS_PER_DIMENSION,
MAX_WORKGROUP_SIZE_X,
)?;
context.insert("workgroup_size_x", &workgroup_size_x);
context.insert("i_chunks", &input_chunks);

NodeTemplate {
scalar_type: agreed_type(input_shapes, output_shapes)?,
template: "matrix/lrn.wgsl",
threads: (x_threads, 1, 1),
}
}
op => return Err(CompileError::UnimplementedOp(op.to_string())),
};

Expand Down
23 changes: 0 additions & 23 deletions wonnx/templates/matrix/lrn.wgsl

This file was deleted.

61 changes: 0 additions & 61 deletions wonnx/tests/localresponsenormalization.rs

This file was deleted.