ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GenH5RandomInputs Namespace Reference

Variables

 parser = argparse.ArgumentParser()
 
 type
 
 str
 
 required
 
 int
 
 args = parser.parse_args()
 
 model = args.model
 
 num_data = args.num_data
 
 output_path = args.output
 
 buf = f.read()
 
 circle_model = Model.GetRootAsModel(buf, 0)
 
 graph = circle_model.Subgraphs(0)
 
 inputs = graph.InputsAsNumpy()
 
 h5_file = h5.File(output_path, 'w')
 
 group = h5_file.create_group("value")
 
 sample = group.create_group(str(i))
 
 input_index = inputs[j]
 
 tensor = graph.Tensors(input_index)
 
 g = RandomDataGenerator(tensor.ShapeAsNumpy())
 
 input_data = g.gen(tensor.Type())
 
 data
 

Variable Documentation

◆ args

GenH5RandomInputs.args = parser.parse_args()

Definition at line 36 of file GenH5RandomInputs.py.

◆ buf

GenH5RandomInputs.buf = f.read()

Definition at line 43 of file GenH5RandomInputs.py.

◆ circle_model

GenH5RandomInputs.circle_model = Model.GetRootAsModel(buf, 0)

Definition at line 44 of file GenH5RandomInputs.py.

◆ data

GenH5RandomInputs.data

Definition at line 64 of file GenH5RandomInputs.py.

◆ g

GenH5RandomInputs.g = RandomDataGenerator(tensor.ShapeAsNumpy())

Definition at line 62 of file GenH5RandomInputs.py.

◆ graph

GenH5RandomInputs.graph = circle_model.Subgraphs(0)

Definition at line 48 of file GenH5RandomInputs.py.

◆ group

GenH5RandomInputs.group = h5_file.create_group("value")

Definition at line 53 of file GenH5RandomInputs.py.

◆ h5_file

GenH5RandomInputs.h5_file = h5.File(output_path, 'w')

Definition at line 52 of file GenH5RandomInputs.py.

◆ input_data

GenH5RandomInputs.input_data = g.gen(tensor.Type())

Definition at line 63 of file GenH5RandomInputs.py.

◆ input_index

GenH5RandomInputs.input_index = inputs[j]

Definition at line 60 of file GenH5RandomInputs.py.

◆ inputs

GenH5RandomInputs.inputs = graph.InputsAsNumpy()

Definition at line 49 of file GenH5RandomInputs.py.

◆ int

GenH5RandomInputs.int

Definition at line 34 of file GenH5RandomInputs.py.

◆ model

GenH5RandomInputs.model = args.model

Definition at line 38 of file GenH5RandomInputs.py.

◆ num_data

GenH5RandomInputs.num_data = args.num_data

Definition at line 39 of file GenH5RandomInputs.py.

◆ output_path

GenH5RandomInputs.output_path = args.output

Definition at line 40 of file GenH5RandomInputs.py.

◆ parser

GenH5RandomInputs.parser = argparse.ArgumentParser()

Definition at line 32 of file GenH5RandomInputs.py.

◆ required

GenH5RandomInputs.required

Definition at line 33 of file GenH5RandomInputs.py.

◆ sample

GenH5RandomInputs.sample = group.create_group(str(i))

Definition at line 58 of file GenH5RandomInputs.py.

◆ str

GenH5RandomInputs.str

Definition at line 33 of file GenH5RandomInputs.py.

◆ tensor

GenH5RandomInputs.tensor = graph.Tensors(input_index)

Definition at line 61 of file GenH5RandomInputs.py.

◆ type

GenH5RandomInputs.type

Definition at line 33 of file GenH5RandomInputs.py.