tensorflow中出现has no attribute contrib

tensorflow2.4中应该怎么解决这个问题

lstm_fw_cell = tf.contrib.rnn.BasicLSTMCell(n_cell_dim, forget_bias=1.0, state_is_tuple=True)
AttributeError: module 'tensorflow.compat.v1' has no attribute 'contrib'

tf.compat.v1.nn.rnn_cell.BasicLSTMCell

在tensorflow官网可以查最新得接口https://tensorflow.google.cn/versions/r2.4/api_docs/python/tf/compat/v1/nn/rnn_cell/BasicLSTMCell?hl=en

谢谢啦,解决了