PaddedConv1D runtime error
What commit version of aidge do you use
aidge 0.2.2
aidge_backend_cpu 0.2.3
aidge_core 0.2.2
Hi, I need a PaddedConv1D for my application so I tried a minimalist inference, but get a bad_cast error.
- Did I do something wrong ?
- Is that Operator implemented for export to cpp or arm_cortexm ?
Thanks a million !
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
---> 30 scheduler.forward(data=[input_tensor])
RuntimeError: std::bad_cast
Reproducible example code
import numpy as np
import aidge_core
# Create node PaddedConv1D
IN_CHANNELS, OUT_CHANNELS= 1, 32
graph_conv = aidge_core.GraphView()
graph_conv.add(aidge_core.PaddedConv1D(in_channels=IN_CHANNELS, out_channels=OUT_CHANNELS, kernel_dims=[3], name="padded_conv1d_0", padding_dims=[1,1], no_bias=True))
# add a zero bias
bias = aidge_core.Producer(aidge_core.Tensor(np.zeros([32], dtype=np.float32)), "bias")
bias.add_child(graph_conv.get_node("padded_conv1d_0"), other_in_id=2)
graph_conv.add(bias)
# visualize
#graph_conv.save("conv")
#visualize_mmd("conv.mmd")
# create input
batch_size = 64
signal_size = 16
x = np.random.rand(batch_size, IN_CHANNELS, signal_size).astype(np.float32) #(1 channel on first vector)
input_tensor=aidge_core.Tensor(x)
print(input_tensor.dims())
# compile
graph_conv.compile("cpu", aidge_core.dtype.float32,dims=[input_tensor.dims()])
## Create SCHEDULER
scheduler = aidge_core.SequentialScheduler(graph_conv)
# Run inference !
scheduler.forward(data=[input_tensor])