def METHOD_NAME(g, tensor_name):
    tensors = [
        tensor
        for tensor in g.get_tensors()
        if xir_extra_ops.remove_xfix(tensor.name) == tensor_name
    ]
    assert len(tensors) == 1, (
        "cannot find tensor: tensor_name="
        + str(tensor_name)
        + " len="
        + str(len(tensors))
        + " all tensors: "
        + "\n\t".join(
            [xir_extra_ops.remove_xfix(tensor.name) for tensor in g.get_tensors()]
        )
    )
    return tensors[0]