3#ifndef EDM4EIC_MutableTensor_H
4#define EDM4EIC_MutableTensor_H
10#include "podio/RelationRange.h"
14#include "podio/utilities/MaybeSharedPtr.h"
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
78 std::int64_t
getShape(std::size_t)
const;
79 std::vector<std::int64_t>::const_iterator
shape_begin()
const;
80 std::vector<std::int64_t>::const_iterator
shape_end()
const;
81 podio::RelationRange<std::int64_t>
getShape()
const;
92 std::vector<std::int64_t>::const_iterator
int64Data_end()
const;
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TensorObj>{
nullptr}; }
114 swap(a.m_obj, b.m_obj);
119 explicit MutableTensor(podio::utils::MaybeSharedPtr<TensorObj> obj);
121 podio::utils::MaybeSharedPtr<TensorObj> m_obj{
nullptr};
124#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
125void to_json(nlohmann::json& j,
const MutableTensor& value);
Definition MutableTensor.h:32
bool isAvailable() const
check whether the object is actually available
Definition MutableTensor.cc:160
void addToFloatData(float)
Definition MutableTensor.cc:83
friend class Tensor
Definition MutableTensor.h:36
MutableTensor(const MutableTensor &other)=default
copy constructor
bool operator<(const MutableTensor &other) const
Definition MutableTensor.h:106
std::vector< float >::const_iterator floatData_end() const
Definition MutableTensor.cc:94
MutableTensor & operator=(MutableTensor other)
copy-assignment operator
Definition MutableTensor.cc:29
void addToInt64Data(std::int64_t)
Definition MutableTensor.cc:119
podio::ObjectID id() const
Definition MutableTensor.h:108
friend class TensorCollection
Definition MutableTensor.h:34
MutableTensor()
default constructor
Definition MutableTensor.cc:21
podio::RelationRange< std::int64_t > getInt64Data() const
Definition MutableTensor.cc:147
friend void swap(MutableTensor &a, MutableTensor &b)
Definition MutableTensor.h:112
podio::RelationRange< float > getFloatData() const
Definition MutableTensor.cc:111
std::size_t floatData_size() const
Definition MutableTensor.cc:100
std::int32_t getElementType() const
Access the Data type in the same encoding as "ONNXTensorElementDataType", 1 - float,...
Definition MutableTensor.cc:41
~MutableTensor()=default
destructor
std::vector< std::int64_t >::const_iterator int64Data_end() const
Definition MutableTensor.cc:130
podio::RelationRange< std::int64_t > getShape() const
Definition MutableTensor.cc:75
std::vector< std::int64_t >::const_iterator int64Data_begin() const
Definition MutableTensor.cc:124
std::vector< std::int64_t >::const_iterator shape_begin() const
Definition MutableTensor.cc:52
bool operator==(const MutableTensor &other) const
Definition MutableTensor.h:102
std::size_t int64Data_size() const
Definition MutableTensor.cc:136
MutableTensor clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableTensor.cc:34
void setElementType(std::int32_t value)
Set the Data type in the same encoding as "ONNXTensorElementDataType", 1 - float, 7 - int64.
Definition MutableTensor.cc:44
std::vector< float >::const_iterator floatData_begin() const
Definition MutableTensor.cc:88
std::size_t shape_size() const
Definition MutableTensor.cc:64
void addToShape(std::int64_t)
Definition MutableTensor.cc:47
std::vector< std::int64_t >::const_iterator shape_end() const
Definition MutableTensor.cc:58
void unlink()
disconnect from TensorObj instance
Definition MutableTensor.h:100
const podio::ObjectID getObjectID() const
Definition MutableTensor.cc:167
Definition TensorCollection.h:95
Definition TensorCollection.h:66
Definition CalorimeterHit.cc:18