litert::Tensor
Summary
Inheritance
Inherits from:
litert::internal::NonOwnedHandle< LiteRtTensor >
Constructors and Destructors
|
Tensor(LiteRtTensor tensor)
|
Public types
TensorUses
absl::InlinedVector< TensorUse, kExpectedMaxNumOfTensorUses > TensorUses
Public functions
DefiningOp
std::optional< LiteRtTensorDefiningOp > DefiningOp() const
ElementType
enum ElementType ElementType() const
HasQuantization
bool HasQuantization() const
HasWeights
bool HasWeights() const
IsConstant
bool IsConstant() const
bool IsSubgraphInput() const
IsSubgraphOutput
bool IsSubgraphOutput() const
Name
absl::string_view Name() const
PerChannelQuantization
LiteRtQuantizationPerChannel PerChannelQuantization() const
PerTensorQuantization
LiteRtQuantizationPerTensor PerTensorQuantization() const
QTypeId
LiteRtQuantizationTypeId QTypeId() const
Tensor
Tensor(
LiteRtTensor tensor
)
TensorIndex
std::uint32_t TensorIndex() const
TypeId
LiteRtTensorTypeId TypeId() const
UnrankedTensorType
Expected< LiteRtUnrankedTensorType > UnrankedTensorType() const
Uses
TensorUses Uses() const
Weights
class Weights Weights() const
WeightsData
Expected< absl::Span< const T > > WeightsData() const
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-14 UTC."],[],[],null,["# litert::Tensor Class Reference\n\nlitert::Tensor\n==============\n\nSummary\n-------\n\n### Inheritance\n\nInherits from: [litert::internal::NonOwnedHandle\\\u003c LiteRtTensor \\\u003e](/edge/api/litert/c/classlitert/1-1internal-1-1-non-owned-handle)\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Tensor](#classlitert_1_1_tensor_1a8bc87c4b83264ddd14337c48eee2c91c)`(LiteRtTensor tensor)` ||\n\n| ### Public types ||\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorUses](#classlitert_1_1_tensor_1af503b80580fbcf3e0bd0ac3525dd2907) | using `absl::InlinedVector\u003c `[TensorUse](/edge/api/litert/c/structlitert/1-1-tensor-1-1-tensor-use#structlitert_1_1_tensor_1_1_tensor_use)`, kExpectedMaxNumOfTensorUses \u003e` |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DefiningOp](#classlitert_1_1_tensor_1a2ebd17cb368b9cbec6a08a6605f122c2)`() const ` | `std::optional\u003c LiteRtTensorDefiningOp \u003e` |\n| [ElementType](#classlitert_1_1_tensor_1a233e42736e330e204508c8abb3f8994b)`() const ` | `enum ElementType` |\n| [HasQuantization](#classlitert_1_1_tensor_1a25797606e54b081aa12ff9866e729b84)`() const ` | `bool` |\n| [HasWeights](#classlitert_1_1_tensor_1abd1f068eaff2564275102eac65c7ec6e)`() const ` | `bool` |\n| [IsConstant](#classlitert_1_1_tensor_1a45818f258d562777dd7946a349f272dd)`() const ` | `bool` |\n| [IsSubgraphInput](#classlitert_1_1_tensor_1ade09e9573e7cef91e0aca0b654f36551)`() const ` | `bool` |\n| [IsSubgraphOutput](#classlitert_1_1_tensor_1a9c70207bcbfe9c2ed2d9598006470e96)`() const ` | `bool` |\n| [Name](#classlitert_1_1_tensor_1a73e6310131b83b27f0c4a3ef09473f54)`() const ` | `absl::string_view` |\n| [PerChannelQuantization](#classlitert_1_1_tensor_1a90b8d1eb3c0b0159014d052190e56c0b)`() const ` | `LiteRtQuantizationPerChannel` |\n| [PerTensorQuantization](#classlitert_1_1_tensor_1a9784e2583ea1ebb3479486d15131fe0b)`() const ` | `LiteRtQuantizationPerTensor` |\n| [QTypeId](#classlitert_1_1_tensor_1ab0e53dc0635119726363850c0145027b)`() const ` | `LiteRtQuantizationTypeId` |\n| [RankedTensorType](#classlitert_1_1_tensor_1a51a292d704bad2f1c4feba00eeb553be)`() const ` | [Expected](/edge/api/litert/c/classlitert/1-1-expected#classlitert_1_1_expected)`\u003c class `[RankedTensorType](/edge/api/litert/c/classlitert/1-1-ranked-tensor-type#classlitert_1_1_ranked_tensor_type)` \u003e` |\n| [TensorIndex](#classlitert_1_1_tensor_1ae8aba6bdc3a1a0960fa520615499c186)`() const ` | `std::uint32_t` |\n| [TypeId](#classlitert_1_1_tensor_1aa7e95aac624a336a1e02a8e167bef7d5)`() const ` | `LiteRtTensorTypeId` |\n| [UnrankedTensorType](#classlitert_1_1_tensor_1a766c0c40da42dc9e47cab6201e7549c4)`() const ` | [Expected](/edge/api/litert/c/classlitert/1-1-expected#classlitert_1_1_expected)`\u003c LiteRtUnrankedTensorType \u003e` |\n| [Uses](#classlitert_1_1_tensor_1a47e9bf2bfba72658c9790b1b0a5db99e)`() const ` | `TensorUses` |\n| [Weights](#classlitert_1_1_tensor_1a43e2511420ac930895f99266602e899e)`() const ` | `class `[Weights](/edge/api/litert/c/classlitert/1-1-weights#classlitert_1_1_weights) |\n| [WeightsData](#classlitert_1_1_tensor_1a7db2ab4299f78fb1211b3fb8aa804a97)`() const ` | [Expected](/edge/api/litert/c/classlitert/1-1-expected#classlitert_1_1_expected)`\u003c absl::Span\u003c const T \u003e \u003e` |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------|---|\n| [litert::Tensor::TensorUse](/edge/api/litert/c/structlitert/1-1-tensor-1-1-tensor-use) | |\n\nPublic types\n------------\n\n### TensorUses\n\n```text\nabsl::InlinedVector\u003c TensorUse, kExpectedMaxNumOfTensorUses \u003e TensorUses\n``` \n\nPublic functions\n----------------\n\n### DefiningOp\n\n```gdscript\nstd::optional\u003c LiteRtTensorDefiningOp \u003e DefiningOp() const \n``` \n\n### ElementType\n\n```gdscript\nenum ElementType ElementType() const \n``` \n\n### HasQuantization\n\n```gdscript\nbool HasQuantization() const \n``` \n\n### HasWeights\n\n```gdscript\nbool HasWeights() const \n``` \n\n### IsConstant\n\n```gdscript\nbool IsConstant() const \n``` \n\n### IsSubgraphInput\n\n```gdscript\nbool IsSubgraphInput() const \n``` \n\n### IsSubgraphOutput\n\n```gdscript\nbool IsSubgraphOutput() const \n``` \n\n### Name\n\n```gdscript\nabsl::string_view Name() const \n``` \n\n### PerChannelQuantization\n\n```gdscript\nLiteRtQuantizationPerChannel PerChannelQuantization() const \n``` \n\n### PerTensorQuantization\n\n```gdscript\nLiteRtQuantizationPerTensor PerTensorQuantization() const \n``` \n\n### QTypeId\n\n```gdscript\nLiteRtQuantizationTypeId QTypeId() const \n``` \n\n### RankedTensorType\n\n```gdscript\nExpected\u003c class RankedTensorType \u003e RankedTensorType() const \n``` \n\n### Tensor\n\n```text\n Tensor(\n LiteRtTensor tensor\n)\n``` \n\n### TensorIndex\n\n```gdscript\nstd::uint32_t TensorIndex() const \n``` \n\n### TypeId\n\n```gdscript\nLiteRtTensorTypeId TypeId() const \n``` \n\n### UnrankedTensorType\n\n```gdscript\nExpected\u003c LiteRtUnrankedTensorType \u003e UnrankedTensorType() const \n``` \n\n### Uses\n\n```gdscript\nTensorUses Uses() const \n``` \n\n### Weights\n\n```gdscript\nclass Weights Weights() const \n``` \n\n### WeightsData\n\n```gdscript\nExpected\u003c absl::Span\u003c const T \u003e \u003e WeightsData() const \n```"]]