Skip to content

[upd] Tensor interface

Maxence Naud requested to merge upd_Tensor-interface into dev

Context

Apply #292 recommendations

Major modifications

  • upd: Tensor getters and boolean query names and make other functions deprecated
    • getImpl() => impl()
    • getImplOffset() => implOffset()
    • dataType() => dtype()
    • dataFormat() => dformat()
    • stride(idx) => X
    • dim(idx) => X
    • undefined() => isUndefined()
    • empty() => isEmpty()
    • hasImpl() => X
    • setDataType() => toDtype()
    • setDataFormat() => toDformat()
    • setBackend() => toBackend()
    • toCoord() => asCoord() // to keep toX for setters that do more computation than setting a variable
    • toIdx() => asIdx()
    • getStorageIdx() => storageIdx()
  • upd: change Tensor Python binding getters to properties (e.g my_tensor.grad => refer to grad() and setGrad())
    • dtype() => dtype
    • dformat() => dformat
    • dims() => dims
    • size() => size
    • capacity() => capacity
    • strides() => strides
    • impl() => impl
Edited by Maxence Naud

Merge request reports

Loading