# dgl.to_float¶

dgl.to_float(g)[source]

Cast this graph to use float32 (single-precision) for any floating-point edge and node feature data.

A shallow copy is returned so that the original graph is not modified. Feature tensors that are not floating-point will not be modified.

Returns

Clone of graph with the feature data converted to float32.

Return type

DGLHeteroGraph