tvm_book.transforms.graphpack#

Relay 实现的 graph packing

Module Contents#

Functions#

_channel_const_match(channel_length, cfactor_out)

Round the channel const variant if the value not divisible by cfactor_out

_const_shape_match(data, dshape, cfactor_out)

Pad the constant if the shape[0] not divisible by cfactor_out.

_get_tensor_shape(node)

Get node shape.

_get_tensor_type(node)

Get node type.

_pack_batch_channel(data, dshape, bfactor, cfactor)

Pack the data channel dimension.

_pack_const(data, dshape, dtype, bfactor, cfactor)

Pack a constant parameter.

_pack_weight(data, dshape, cfactor)

Pack the weight into packed format.

_pack_weight_conv2d_transpose(data, dshape, cfactor)

Pack the weight into packed format.

_to_shape(shape)

convert shape into tuple.

_unpack_batch_channel(data, old_shape[, unpack_transpose])

Unpack the data channel dimension.

_weight_shape_match(data, dshape, channels, cfactor_out)

Pad the weight if the shape[0] not divisible by cfactor_out.

_weight_shape_match_transpose(data, dshape, channels, ...)

Pad the weight if the shape[1] not divisible by cfactor_out.

tvm_book.transforms.graphpack._channel_const_match(channel_length, cfactor_out)[源代码]#

Round the channel const variant if the value not divisible by cfactor_out

tvm_book.transforms.graphpack._const_shape_match(data, dshape, cfactor_out)[源代码]#

Pad the constant if the shape[0] not divisible by cfactor_out.

tvm_book.transforms.graphpack._get_tensor_shape(node)[源代码]#

Get node shape.

tvm_book.transforms.graphpack._get_tensor_type(node)[源代码]#

Get node type.

tvm_book.transforms.graphpack._pack_batch_channel(data, dshape, bfactor, cfactor)[源代码]#

Pack the data channel dimension.

tvm_book.transforms.graphpack._pack_const(data, dshape, dtype, bfactor, cfactor)[源代码]#

Pack a constant parameter.

tvm_book.transforms.graphpack._pack_weight(data, dshape, cfactor)[源代码]#

Pack the weight into packed format.

tvm_book.transforms.graphpack._pack_weight_conv2d_transpose(data, dshape, cfactor)[源代码]#

Pack the weight into packed format.

tvm_book.transforms.graphpack._to_shape(shape)[源代码]#

convert shape into tuple.

tvm_book.transforms.graphpack._unpack_batch_channel(data, old_shape, unpack_transpose=False)[源代码]#

Unpack the data channel dimension.

tvm_book.transforms.graphpack._weight_shape_match(data, dshape, channels, cfactor_out, transpose=False)[源代码]#

Pad the weight if the shape[0] not divisible by cfactor_out.

tvm_book.transforms.graphpack._weight_shape_match_transpose(data, dshape, channels, cfactor_out)[源代码]#

Pad the weight if the shape[1] not divisible by cfactor_out.