3#ifndef EDM4EIC_MutableTensor_H
4#define EDM4EIC_MutableTensor_H
10#include "podio/RelationRange.h"
14#include "podio/utilities/MaybeSharedPtr.h"
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
78 [[deprecated(
"use getElementType instead")]]
85 std::int64_t
getShape(std::size_t)
const;
86 std::vector<std::int64_t>::const_iterator
shape_begin()
const;
87 std::vector<std::int64_t>::const_iterator
shape_end()
const;
88 podio::RelationRange<std::int64_t>
getShape()
const;
99 std::vector<std::int64_t>::const_iterator
int64Data_end()
const;
100 podio::RelationRange<std::int64_t>
getInt64Data()
const;
107 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TensorObj>{
nullptr}; }
122 friend std::hash<MutableTensor>;
126 swap(a.m_obj, b.m_obj);
131 explicit MutableTensor(podio::utils::MaybeSharedPtr<TensorObj> obj);
133 podio::utils::MaybeSharedPtr<TensorObj> m_obj{
new TensorObj{}, podio::utils::MarkOwned};
136#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
148 return std::hash<edm4eic::TensorObj*>{}(obj.m_obj.get());
Definition MutableTensor.h:35
bool isAvailable() const
check whether the object is actually available
Definition MutableTensor.cc:167
TensorCollection collection_type
Definition MutableTensor.h:43
friend class Tensor
Definition MutableTensor.h:39
MutableTensor(const MutableTensor &other)=default
copy constructor
bool operator<(const MutableTensor &other) const
Definition MutableTensor.h:116
std::vector< float >::const_iterator floatData_end() const
Definition MutableTensor.cc:101
bool operator!=(const MutableTensor &other) const
Definition MutableTensor.h:112
bool operator!=(const Tensor &other) const
Definition MutableTensor.h:113
MutableTensor clone(bool cloneRelations=true) const
Definition MutableTensor.cc:27
void addToInt64Data(const std::int64_t &)
Definition MutableTensor.cc:126
void addToFloatData(const float &)
Definition MutableTensor.cc:90
podio::ObjectID id() const
Definition MutableTensor.h:118
friend class TensorCollection
Definition MutableTensor.h:37
MutableTensor & operator=(MutableTensor other) &
copy-assignment operator
Definition MutableTensor.cc:22
podio::RelationRange< std::int64_t > getInt64Data() const
Definition MutableTensor.cc:154
Tensor object_type
Definition MutableTensor.h:42
friend void swap(MutableTensor &a, MutableTensor &b)
Definition MutableTensor.h:124
podio::RelationRange< float > getFloatData() const
Definition MutableTensor.cc:118
std::size_t floatData_size() const
Definition MutableTensor.cc:107
MutableTensor & operator=(MutableTensor other) &&=delete
std::int32_t getElementType() const
Access the Data type in the same encoding as "ONNXTensorElementDataType", 1 - float,...
Definition MutableTensor.cc:46
~MutableTensor()=default
destructor
std::vector< std::int64_t >::const_iterator int64Data_end() const
Definition MutableTensor.cc:137
podio::RelationRange< std::int64_t > getShape() const
Definition MutableTensor.cc:82
std::vector< std::int64_t >::const_iterator int64Data_begin() const
Definition MutableTensor.cc:131
std::vector< std::int64_t >::const_iterator shape_begin() const
Definition MutableTensor.cc:59
bool operator==(const MutableTensor &other) const
Definition MutableTensor.h:109
std::size_t int64Data_size() const
Definition MutableTensor.cc:143
void setElementType(const std::int32_t elementType)
Set the Data type in the same encoding as "ONNXTensorElementDataType", 1 - float, 7 - int64.
Definition MutableTensor.cc:49
friend class TensorMutableCollectionIterator
Definition MutableTensor.h:38
std::int32_t & elementType()
Get reference to Data type in the same encoding as "ONNXTensorElementDataType", 1 - float,...
Definition MutableTensor.cc:51
std::vector< float >::const_iterator floatData_begin() const
Definition MutableTensor.cc:95
std::size_t shape_size() const
Definition MutableTensor.cc:71
void addToShape(const std::int64_t &)
Definition MutableTensor.cc:54
std::vector< std::int64_t >::const_iterator shape_end() const
Definition MutableTensor.cc:65
void unlink()
disconnect from TensorObj instance
Definition MutableTensor.h:107
MutableTensor()=default
default constructor
const podio::ObjectID getObjectID() const
Definition MutableTensor.cc:171
Definition TensorCollection.h:138
Definition TensorObj.h:19
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTensor &obj) const
Definition MutableTensor.h:147