MCPcopy Create free account
hub / github.com/UbiquitousLearning/mllm / empty

Method empty

mllm/core/Tensor.cpp:78–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76Tensor::Tensor(const std::shared_ptr<TensorViewImpl>& impl) : impl_(impl) {}
77
78Tensor Tensor::empty(const std::vector<int32_t>& shape, DataTypes dtype, DeviceTypes device) {
79 auto storage = TensorStorage::create(shape, dtype, device);
80 auto impl = TensorViewImpl::create(shape, storage);
81 return Tensor(impl);
82}
83
84Tensor Tensor::constant(float x, DataTypes dtype, DeviceTypes device) {
85 auto rhs_tensor = Tensor::empty({1}, dtype, device).alloc();

Callers 15

__init__Method · 0.45
emptyFunction · 0.45
test_empty_tensor_createFunction · 0.45
splitStringFunction · 0.45
ArgparseClass · 0.45
splitFlagsMethod · 0.45
pollResponseFunction · 0.45
Tensor.cppFile · 0.45
squeezeMethod · 0.45
reshapeMethod · 0.45
reshapeMethod · 0.45

Calls 1

TensorClass · 0.70

Tested by 1

test_empty_tensor_createFunction · 0.36