3#ifndef EDM4EIC_Tensor_H
4#define EDM4EIC_Tensor_H
8#include "podio/RelationRange.h"
12#include "podio/utilities/MaybeSharedPtr.h"
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
26class TensorCollection;
27class TensorCollectionData;
48 Tensor(std::int32_t elementType);
73 std::int64_t
getShape(std::size_t)
const;
74 std::vector<std::int64_t>::const_iterator
shape_begin()
const;
75 std::vector<std::int64_t>::const_iterator
shape_end()
const;
76 podio::RelationRange<std::int64_t>
getShape()
const;
85 std::vector<std::int64_t>::const_iterator
int64Data_end()
const;
92 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TensorObj>{
nullptr}; }
106 swap(a.m_obj, b.m_obj);
111 explicit Tensor(podio::utils::MaybeSharedPtr<TensorObj> obj);
114 podio::utils::MaybeSharedPtr<TensorObj> m_obj{
nullptr};
117std::ostream&
operator<<(std::ostream& o,
const Tensor& value);
119#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
120void to_json(nlohmann::json& j,
const Tensor& value);
Definition MutableTensor.h:32
Definition TensorCollectionData.h:30
Definition TensorCollection.h:95
Definition TensorCollection.h:40
std::vector< std::int64_t >::const_iterator int64Data_begin() const
Definition Tensor.cc:114
bool isAvailable() const
check whether the object is actually available
Definition Tensor.cc:149
std::vector< float >::const_iterator floatData_begin() const
Definition Tensor.cc:82
podio::RelationRange< std::int64_t > getInt64Data() const
Definition Tensor.cc:137
std::vector< std::int64_t >::const_iterator int64Data_end() const
Definition Tensor.cc:120
std::int32_t getElementType() const
Access the Data type in the same encoding as "ONNXTensorElementDataType", 1 - float,...
Definition Tensor.cc:46
std::size_t floatData_size() const
Definition Tensor.cc:94
podio::RelationRange< float > getFloatData() const
Definition Tensor.cc:105
std::vector< std::int64_t >::const_iterator shape_end() const
Definition Tensor.cc:56
podio::ObjectID id() const
Definition Tensor.h:100
bool operator<(const Tensor &other) const
Definition Tensor.h:98
friend class TensorCollection
Definition Tensor.h:36
friend void swap(Tensor &a, Tensor &b)
Definition Tensor.h:104
std::vector< float >::const_iterator floatData_end() const
Definition Tensor.cc:88
std::size_t shape_size() const
Definition Tensor.cc:62
MutableTensor clone() const
create a mutable deep-copy of the object with identical relations
Definition Tensor.cc:34
Tensor()
default constructor
Definition Tensor.cc:21
bool operator==(const Tensor &other) const
Definition Tensor.h:94
const podio::ObjectID getObjectID() const
Definition Tensor.cc:156
friend class MutableTensor
Definition Tensor.h:35
void unlink()
disconnect from TensorObj instance
Definition Tensor.h:92
podio::RelationRange< std::int64_t > getShape() const
Definition Tensor.cc:73
std::size_t int64Data_size() const
Definition Tensor.cc:126
Tensor & operator=(Tensor other)
copy-assignment operator
Definition Tensor.cc:29
Tensor(const Tensor &other)=default
copy constructor
static Tensor makeEmpty()
Definition Tensor.cc:42
~Tensor()=default
destructor
std::vector< std::int64_t >::const_iterator shape_begin() const
Definition Tensor.cc:50
Definition TensorObj.h:18
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97