@George_Soloupis
Since I need to have a dilated and causal convolutional 1D op which can be supported by TF Lite (and we have a Conv1D supported by TF), I think I might as well not use my custom TF conv op above, and instead use the class Conv1D. Following the tutorial Custom operators  |  TensorFlow Lite I tried to implement this very simple conv1D:
#include "tensorflow/lite/kernels/conv_1d.h"

#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include "tensorflow/lite/c/common.h"

#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/tensor.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"

namespace tflite {
namespace ops {
namespace custom {
namespace conv_1d {

const int dim = 5;
int dim_in;  
int dim_out;  
int dim_k = 3;
float copy[dim];

constexpr float kernel[3] = {1.2,2.0,4.2};
constexpr int dilation = 2;

TfLiteStatus Conv1dPrepare(TfLiteContext* context, TfLiteNode* node) {

TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);

const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);

int num_dims = NumDimensions(input);

TfLiteIntArray* output_size = TfLiteIntArrayCreate(num_dims);
for (int i=0; i<num_dims; ++i) {
   output_size->data[i] = input->dims->data[i];
}

return context->ResizeTensor(context, output, output_size);
}

TfLiteStatus Conv1dEval(TfLiteContext* context, TfLiteNode* node) {

 const TfLiteTensor* input = GetInput(context, node,0);
 TfLiteTensor* output = GetOutput(context, node,0);

 float* input_data = input->data.f;
 float* output_data = output->data.f;

 if (output->dims->data[0] > 1)
  dim_out = output->dims->data[0];

 else dim_out = output->dims->data[1];

 if (input->dims->data[0] > 1)
   dim_in = input->dims->data[0];

else dim_in = input->dims->data[1];

float copy0[4+dim_in];

for (int i=0; i<4; i++) {
copy0[i] = 0;
}

for (int i=0; i<dim_in; i++) {
 copy0[i+4] = input_data[i];
}

for (int i=0; i<dim_out; i++) {
  for (int m=0; m<dim; m++) {
   copy[m] = copy0[m+i];
  }
  for (int j=0; j<dim_k; j++) {
   output_data[i] = output_data[i] + copy[j*dilation]*kernel[j];
   }

 }
return kTfLiteOk;
}


}  // namespace conv_1d

TfLiteRegistration* Register_CONV_1D() {
static TfLiteRegistration r = {nullptr, nullptr, conv_1d::Conv1dPrepare, conv_1d::Conv1dEval};
return &r;
}

}  // namespace custom
}  // namespace ops
}  // namespace tflite

However, I always use a fixed kernel which is not trainable. In order to access weights created by the Class Conv1D and other inputs, how can I do? Then I’d like to use this code in Python to register the op:
import tensorflow as tf
tf.config.run_functions_eagerly(True)
from keras.datasets import mnist
from keras.models import Model
from keras.layers import Conv1D,Activation,Input,Flatten,Dense

num_filters = 32
kern_size = 3

@tf.function
def convol(inp, num_filters, kern_size):
   r = Conv1D(filters = num_filters, kernel_size = kern_size, name="cd1")(inp)
   return x

def read_mnist(path):
  (train_x,train_y), (test_x,test_y)=mnist.load_data()
  return train_x,train_y,test_x,test_y

def tcn(train_x,train_y,test_x,test_y):
     inp=Input(shape=(28,28))
     x = convol(inp,num_filters,kern_size)
     x=Flatten()(x)
     x=Dense(10,activation='softmax')(x)
     model=Model(inputs=inp,outputs=x)
     model.summary()
     model.compile(loss='sparse_categorical_crossentropy', optimizer='adam', metrics= 
     ['accuracy'])
     model.fit(train_x,train_y,batch_size=100,epochs=10,validation_data=(test_x,test_y))
     pred=model.evaluate(test_x,test_y,batch_size=100)
     print('test_loss:',pred[0],'- test_acc:',pred[1])

train_x,train_y,test_x,test_y=read_mnist('MNIST_data')
tcn(train_x,train_y,test_x,test_y)
tflite_model_name = 'net'
inp=Input(shape=(28,28))
converter =  tf.lite.TFLiteConverter.from_concrete_functions([convol.get_concrete_function(inp,num_filters,kern_size)])
converter.allow_custom_ops = True
tflite_model = converter.convert()
open(tflite_model_name + '.tflite', 'wb').write(tflite_model)