def METHOD_NAME(elem):
    assert not isinstance(elem, Tensor), f"not expected to see Tensor {elem} in net dict"
    if isinstance(elem, Dim):
        # Dim dyn_size_ext might be Tensor[rfl.Layer],
        # but now the TF engine actually wants to have Tensor[tf.Tensor].
        # Reset it now. The TF engine should redefine it again.
        if elem.dyn_size_ext:
            elem.dyn_size_ext.raw_tensor = None
    return elem