Problems when import BERT model from PyTorch Relay

Thanks!

I try to fix it by

def _tensortonum():
    def _impl(inputs, input_types):
        return inputs[0]
    return _impl

Another error accurs:

TypeError: int() argument must be a string, a bytes-like object or a number, not 'Call'
'58', %58 : Scalar = prim::ImplicitTensorToNum(%57),
......
'position_ids.1', %position_ids.1 : Long(7) = aten::arange(%59, %58, %60, %61, %62, %63, %64)

‘aten::arange’ will _create_typed_const(inputs[1], dtype), but ‘inputs[1]’ is ‘Call’, that’s the reason of ‘TypeError’ mentioned above.

So I use the following implementation.

def _tensortonum():
    def _impl(inputs, input_types):
        tmp = _infer_value(inputs[0], None)
        return np.array(tmp).astype(np.str)
    return _impl

It works, but I’m not sure if it is correct because when it goes to ‘aten::view’, the following error accurs:

TVMError: Check failed: ObjectTypeChecker<TObjectRef>: :Check(ptr): Expect List[IntImm] but get Array

It seems like something is wrong when it goes to: _op.transform.reshape(data, new_shape)