fn
make_ones_storage
→Storageint make_ones_storage(const int & shape, Dtype dtype, Device device)Allocate a ones-filled Storage on the requested device.
Used by Engine::backward as the default seed gradient when the
caller does not supply an explicit grad argument.
Parameters
shapeconst Shape&N-D shape of the resulting storage.
dtypeDtypeElement dtype.
deviceDeviceTarget device.
Returns
StorageStorage with every element equal to one.