Question about BertForQuestionAnswering model
Author: geekboood
Pull request: no

Hi, I want to train `BertForQuestionAnswering` with my own dataset. I have already taken care of the format of the dataset, however, I encounter some problem when I want to do the inference job. If I am right, the forward output of the model is `start_logits` and `end_logits`. When I use `batchsize=1`, the output shape of both `start_logits` and `end_logits` is `(1, 384)`, with the condition that `max_seq_length=384`. 
And the content of the `start_logits` looks like this. 
`tensor([[-146.7531, -124.1240,  190.8818,   47.8019, -188.0909,   47.2568,
           47.7160,  190.8021,   48.0589,  190.8891,  -88.2698,  -90.5676,
          -86.6798,  -85.8938,  -83.8673,  -86.1693, -149.1830,  190.8824,
           48.2365,   47.0692,   48.6216,   47.5917,  190.8883,  -88.3360,
         -141.6174, -188.1515, -188.1540,  -53.4689,   46.8519, -188.1528,
          -53.4642,   47.6210,   44.1266,  190.4762,   47.4085,  -53.7023,
           46.8320,   46.7578, -188.1541,  -53.4671,   47.3207,   47.8246,
         -188.1536,  -53.7048,   46.7347, -188.1540,   45.1644,   47.1797,
          -53.7898,   47.3539,  190.8893,   46.2768,   44.3791,   47.1278,
         -188.1544,   43.0797,   46.6862,   45.7719,  190.8861,   46.1606,
           47.4132, -188.1537,   36.1658,   47.0910,   48.5226,   46.2841,
           46.6541,   47.2510,   46.7009,   47.6877,   47.6154,   44.2239,
         -187.5396,  -53.2560,   47.2695,   46.6610,   48.0983, -169.4403,
         -187.6610,   45.5523,   42.2900, -188.1411,  190.2228,   46.8949,
          190.8703,   45.7234,   46.2740,   47.1369, -188.1532,  -54.4368,
           47.4453,   47.8158,  190.8736,   48.5765,   46.3732,   47.6971,
          190.8648,   47.9480,  190.8680,  190.8193,   47.7762,  190.8790,
           47.3178,   47.6414,  190.8697,   47.4176,  190.8666,   46.2278,
         -188.1528,   44.4261,   47.4981,   44.7491,   47.1290,   47.4565,
          -53.6217,   47.1531, -188.1532,  -53.8363,  190.8584,  190.8332,
           47.3138, -181.1877,   47.6136,  190.8501,  189.9186,   47.7481,
          190.8734,   46.6971,   47.2033,   47.2970,   46.3130, -188.1545,
           46.3114,   46.7054,   46.5795,  190.8862,   46.9812,   47.3662,
           47.1590,   45.7121,   47.1540,   46.6390,   47.0824,   46.8635,
           47.3509,   47.0953,   46.6325,  190.8554,   46.4527,   45.5026,
           25.4061,  190.8870,   46.7979,   47.2999,   45.9724,   47.1344,
           46.6824,  190.8658,   47.0369,   46.7866,  190.8427,   47.2813,
           46.6452,   47.3353,   46.7846,  190.8449,   47.2189,   45.9533,
         -188.1514,   47.8233,  190.8823,   47.5980,   47.1329,   48.1479,
           47.0462,   45.7567,   37.7330,   47.4664,  190.8853,   47.6274,
           47.3734,  190.8493,   45.9364,   46.3813,   47.6914,   46.7994,
           47.1847,   46.3399,   47.4068,   47.3856,  190.8252,   46.8805,
          190.8525,   48.3069,   46.0178,   47.0109,   47.4094,   47.7603,
          190.8745,  190.8543,  190.8878,  190.8569,  190.8248,  190.8730,
          190.8667,  190.8854,  190.8804,   47.4608,  190.8710,  190.8739,
          190.8552,  190.8687,  190.8698,  190.8622,  190.8847,  190.8673,
          190.8881,   48.5061,  190.8691,  190.8752,  190.8887,  190.8773,
          190.8719,  190.8861,  190.8807,  190.8661,  190.8884,   47.6262,
           47.9787,  190.8649,  190.8735,  190.8645,  190.8862,  190.8828,
          190.8752,  190.8871,  190.8723,   47.5396,  190.8626,  190.8553,
          190.8613,  190.8476,  190.8685,  190.8499,  190.8742,  190.8689,
          190.8845,  190.8497,   47.2941,  190.8490,  190.8656,  190.8815,
          190.8670,  190.8566,  190.8673,  190.8823,  190.8686,  190.8822,
          190.8694,  190.8720,  190.8715,  190.8867,   48.3389,  190.8861,
           47.6601,  190.8593,  190.8729,   48.1891,  190.8771,   48.9684,
          190.8796,  190.8530,  190.8772,  190.8604,  190.8855,  190.8657,
          190.8313,  190.8068,   47.2093,   45.8342,  190.8693,   47.0122,
          190.8611,   47.9197,   47.5900,  190.8699,   47.1812,   47.0453,
           47.8088,   47.3929,  190.8647,   47.4646,  190.8573,   47.6600,
          190.8750,   49.9670,   48.0235,  190.8890,   47.1344,   46.9663,
           47.8146,   47.5412,   47.8123,   47.0196,  190.8707, -188.1540,
           45.6518,  -53.6818,   47.1032, -188.1543,   47.6412,  190.8764,
          -53.6656,   47.0526,   46.7920,   47.4910,   46.0659,  190.8813,
           47.5103,   44.4868,   47.5182,   46.9884,   48.5096,   47.3874,
           46.8767,  190.8836,   47.0396,   47.2361,   47.2189,    8.5557,
          190.7647,   47.0486,   47.3513,   46.9460,   49.2101,   47.4387,
           47.0915,  190.8861,   46.8415,   46.8162, -188.1539, -188.1529,
           47.7122,  -51.9730,   47.0126,   47.7990,   47.2502,   47.2899,
           45.7776,   47.0698,   47.1549,   47.5327,   47.0973,   47.0441,
          -52.2246,   47.0743,   46.0908, -141.6221,   47.2081,   47.1517,
           47.2605,   47.1618,   47.2170,   47.2807,   47.2537,   47.2298,
           47.3016,   47.3111,   47.2860,   47.2685,   47.3075,   47.2483,
           47.2479,   47.2315,   47.1936,   47.2113,   47.2494,   47.2810,
           47.2674,   47.3000,   47.3290,   47.3196,   47.2996,   47.3611]],
       grad_fn=<SqueezeBackward1>)`
Is this behaving normally? Shouldn't it a `(1, 1)` tensor?

Comments: