1 #ifndef _CORE_WORKSPACE_H_
2 #define _CORE_WORKSPACE_H_
7 #include "smaug/core/tensor.h"
8 #include "smaug/core/operator.h"
21 for (
auto& tensor : tensors)
26 tensors[tensor->getName()] =
static_cast<TensorBase*
>(tensor);
31 for (
auto i = tiledTensor.startIndex(); !i.end(); ++i) {
32 Tensor* tensor = tiledTensor[i];
33 tensors[tensor->getName()] =
static_cast<TensorBase*
>(tensor);
37 Tensor* getTensor(
const std::string& name)
const {
38 if (tensors.find(name) == tensors.end())
40 return dynamic_cast<Tensor*
>(tensors.at(name));
44 return getTensor(op->getName());
48 std::map<std::string, TensorBase*> tensors;