-
-
Save IanWood1/a6916d7a4f3762a2776bce51325f37c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# Define the input specifications | |
inputs = [ | |
("input1.npy", (2, 66, 66, 640), np.int8, 100), | |
("input2.npy", (3, 3, 640, 640), np.int8, 10), | |
("input3.npy", (640,), np.int32, 300), | |
("input4.npy", (640,), np.float32, 0.0005), | |
("input5.npy", (2, 640), np.float32, 0.1), | |
("input6.npy", (640,), np.float16, 0.01), | |
("input7.npy", (2, 640, 64, 64), np.float16, 0.01) | |
] | |
# Generate and save the .npy files | |
for filename, shape, dtype, scale in inputs: | |
data = (np.random.rand(*shape) * scale).astype(dtype) | |
np.save(filename, data, allow_pickle=False) | |
# Run the test | |
print("Files generated successfully.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment