SetContext
~TensorContext
函数功能
TensorContext类的默认析构函数。
函数原型
~TensorContext();
父主题: TensorContext
GetInstance
函数功能
获取TensorContext单例对象。
函数原型
static std::shared_ptr<TensorContext> GetInstance();
返回参数说明
| 数据结构 | 说明 |
|---|---|
| std::shared_ptr | TensorContext单例对象。 |
父主题: TensorContext
SetContext
函数功能
设置线程的Context。
函数原型
APP_ERROR SetContext(const uint32_t &deviceId);
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| deviceId | 输入 | 线程当前的deviceId。 |
返回参数说明
| 数据结构 | 说明 |
|---|---|
| APP_ERROR | 程序执行返回的错误码,请参考APP_ERROR说明。 |
父主题: TensorContext
类说明
该类主要有TensorShape数据结构的构造方法和相关的功能接口。
父主题: TensorShape
TensorShape
函数功能
TensorShape构造函数,创建TensorShape()对象。
函数原型
TensorShape() = default;
TensorShape (std::vector<T> shape);
参数说明
| 参数名 | 输入/输出 | 说明 |
|---|---|---|
| shape | 输入 | Tensor的形状。 shape向量中各维度要求为正整数且单个或各项乘积需要小于52,428,8000(500MB),否则函数将抛出异常。 |
父主题: TensorShape
~TensorShape
函数功能
TensorShape类的默认析构函数。
函数原型
~TensorShape() = default;
父主题: TensorShape
在线提单