change(tensor): move ts.AtDevice from c_generated to tensor.go
This commit is contained in:
parent
579abdb750
commit
959a1c8a99
|
@ -25,12 +25,6 @@ func AtgTo(ptr *Ctensor, self Ctensor, device int) {
|
|||
C.atg_to(ptr, self, cdevice)
|
||||
}
|
||||
|
||||
// int at_device(tensor);
|
||||
func AtDevice(ts Ctensor) int {
|
||||
cint := C.at_device(ts)
|
||||
return *(*int)(unsafe.Pointer(&cint))
|
||||
}
|
||||
|
||||
// void atg_grad(tensor *, tensor self);
|
||||
func AtgGrad(ptr *Ctensor, self Ctensor) {
|
||||
C.atg_grad(ptr, self)
|
||||
|
|
|
@ -40,6 +40,12 @@ func NewTensor() Ctensor {
|
|||
return C.at_new_tensor()
|
||||
}
|
||||
|
||||
// int at_device(tensor);
|
||||
func AtDevice(ts Ctensor) int {
|
||||
cint := C.at_device(ts)
|
||||
return *(*int)(unsafe.Pointer(&cint))
|
||||
}
|
||||
|
||||
// tensor at_tensor_of_data(void *vs, int64_t *dims, size_t ndims, size_t element_size_in_bytes, int type);
|
||||
func AtTensorOfData(vs unsafe.Pointer, dims []int64, ndims uint, elt_size_in_bytes uint, kind int) Ctensor {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user