Printing `MPSGraphTensor.dataType`

Hello,

printing the dataType property some tensor, results in a non-disclosing "MPSDataType" string. Is this intended? If so, how do I get string representation of type of the tensor please?

let graph = MPSGraph()
print(graph.constant(23.0, dataType: .float32).dataType)
// prints "MPSDataType", and not "f32" or something useful
Answered by mlajtos in 695654022
extension MPSDataType {
    func description() -> String {
        switch(self) {

        case .float32:
            return "f32"

        case .int32:
            return "i32"

        // other...

        default:
            return "?"
        }
    }
}
Accepted Answer
extension MPSDataType {
    func description() -> String {
        switch(self) {

        case .float32:
            return "f32"

        case .int32:
            return "i32"

        // other...

        default:
            return "?"
        }
    }
}
Printing `MPSGraphTensor.dataType`
 
 
Q