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{
nullptr};
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:171
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:105
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:31
void addToInt64Data(const std::int64_t &)
Definition MutableTensor.cc:130
void addToFloatData(const float &)
Definition MutableTensor.cc:94
podio::ObjectID id() const
Definition MutableTensor.h:118
friend class TensorCollection
Definition MutableTensor.h:37
MutableTensor()
default constructor
Definition MutableTensor.cc:18
MutableTensor & operator=(MutableTensor other) &
copy-assignment operator
Definition MutableTensor.cc:26
podio::RelationRange< std::int64_t > getInt64Data() const
Definition MutableTensor.cc:158
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:122
std::size_t floatData_size() const
Definition MutableTensor.cc:111
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:50
~MutableTensor()=default
destructor
std::vector< std::int64_t >::const_iterator int64Data_end() const
Definition MutableTensor.cc:141
podio::RelationRange< std::int64_t > getShape() const
Definition MutableTensor.cc:86
std::vector< std::int64_t >::const_iterator int64Data_begin() const
Definition MutableTensor.cc:135
std::vector< std::int64_t >::const_iterator shape_begin() const
Definition MutableTensor.cc:63
bool operator==(const MutableTensor &other) const
Definition MutableTensor.h:109
std::size_t int64Data_size() const
Definition MutableTensor.cc:147
void setElementType(const std::int32_t elementType)
Set the Data type in the same encoding as "ONNXTensorElementDataType", 1 - float, 7 - int64.
Definition MutableTensor.cc:53
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:55
std::vector< float >::const_iterator floatData_begin() const
Definition MutableTensor.cc:99
std::size_t shape_size() const
Definition MutableTensor.cc:75
void addToShape(const std::int64_t &)
Definition MutableTensor.cc:58
std::vector< std::int64_t >::const_iterator shape_end() const
Definition MutableTensor.cc:69
void unlink()
disconnect from TensorObj instance
Definition MutableTensor.h:107
const podio::ObjectID getObjectID() const
Definition MutableTensor.cc:175
Definition TensorCollection.h:137
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableTensor &obj) const
Definition MutableTensor.h:147