提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。
提示:以下是本篇文章正文内容,下面案例可供参考
一、LLVMIR中的Value Use User的关系
图示i32 %1 = add i32 %2, i32%3
,定义了三个变量%1 , %2,%3
。图示展示了三个变量在代码层面的构成逻辑。
为了保证Value
的可复用性。引入了User Use Value
。
User
本质也是Value
.
User
代表输出时,User->hidden pointer
指向了它的输入参数,这里用Use
作为中介,再指向最终的数据Value
。- 如果某个Value被多次使用,那么一定有多个Use与之关联。
Use
中Next、 Prev
的构成了这些Use的链表。这某个Value 的UseList
指向第一个Use。最后一个Use的Next
指向这某个Value。
二、SDNode
1.引入库
代码如下(示例):
class SDNode {
DebugLoc debugLoc;//source line information,记录原行信息
unsigned short NumOperands;
unsigned short NumValues;
private:
friend class SelectionDAG;
// TODO: unfriend HandleSDNode once we fix its operand handling.
friend class HandleSDNode;
/// Unique id per SDNode in the DAG.
int NodeId = -1;
/// The values that are used by this operation.
SDUse *OperandList = nullptr;
/// The types of the values this node defines. SDNode's may
/// define multiple values simultaneously.
const EVT *ValueList;
/// List of uses for this SDNode.
SDUse *UseList = nullptr;
/// The number of entries in the Operand/Value list.
unsigned short NumOperands = 0;
unsigned short NumValues;
// The ordering of the SDNodes. It roughly corresponds to the ordering of the
// original LLVM instructions.
// This is used for turning off scheduling, because we'll forgo
// the normal scheduling algorithms and output the instructions according to
// this ordering.
unsigned IROrder;
/// Source line information.
DebugLoc debugLoc;
class SDValue {
friend struct DenseMapInfo<SDValue>;
SDNode *Node = nullptr; // The node defining the value we are using.
unsigned ResNo = 0; // Which return value of the node we are using.
get the index which selects a specific result in the SDNode
Value可以直接转为SDValue;
SDValue可以直接定向SDNode;
SDUse是核心,SDNode指明用的数据节点,SDValue->ResNo指明使用该数据节点中的哪一个结果。
2.读入数据
代码如下(示例):
data = pd.read_csv(
'https://labfile.oss.aliyuncs.com/courses/1283/adult.data.csv')
print(data.head())
该处使用的url网络请求的数据。
总结
提示:这里对文章进行总结:
例如:以上就是今天要讲的内容,本文仅仅简单介绍了pandas的使用,而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。