How can I modify c++ files in pytorch?

@ptrblck @sprakashdash I get the following error:

Traceback (most recent call last):
  File "/media/amgb20/KINGSTON/University of Bath/UoB - 5th year/Semester 2/FYP/FYP/code/GMG_model/basic_model/backbone.py", line 777, in <module>
    run_all()
  File "/media/amgb20/KINGSTON/University of Bath/UoB - 5th year/Semester 2/FYP/FYP/code/GMG_model/basic_model/backbone.py", line 695, in run_all
    GRUDense_loss_list, GPloss_list, supvised_loss_list, predictive_var_list, GRUDense_test_df, GRUDense_test_MAE, GRUDense_test_RMSE, GP_test_df, GP_test_MAE, GP_test_RMSE, time_cost = run_item(input_data, config, device, result_log_paths)
  File "/media/amgb20/KINGSTON/University of Bath/UoB - 5th year/Semester 2/FYP/FYP/code/GMG_model/basic_model/backbone.py", line 243, in run_item
    feature_extractor = GRU_Dense(gru_dense_para, num_features=num_features, device=device).to(device)
  File "/media/amgb20/KINGSTON/University of Bath/UoB - 5th year/Semester 2/FYP/FYP/code/GMG_model/basic_model/myfeature.py", line 195, in __init__
    self.gru = nn.GRU(input_size=self.input_size,hidden_size=self.hidden_size,num_layers=self.num_layers,bias=True,batch_first=True,dropout=self.dropout,bidirectional=True)
  File "/data/test2/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 1073, in __init__
    super().__init__('GRU', *args, **kwargs)
  File "/data/test2/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 149, in __init__
    self._init_flat_weights()
  File "/data/test2/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 158, in _init_flat_weights
    self.flatten_parameters()
  File "/data/test2/lib/python3.8/site-packages/torch/nn/modules/rnn.py", line 210, in flatten_parameters
    torch._cudnn_rnn_flatten_weight(
RuntimeError: shape '[45, 1]' is invalid for input of size 75

Are you sure I did not have to handle any tensors or other params in the RNN.cpp file ?

If not, it would be a python backend problem

Hi @ptrblck,

I was wondering if you figured out a way to sort out my issue.

I am still stucked :slight_smile: