mxfusion.util.util

Members

mxfusion.util.util.slice_axis(F, array, axis, indices)

Slice an array along a given axis by a list of indices.

Parameters:
  • array (MXNet Array) – the array to be sliced.
  • axis (int) – the axis to be sliced.
  • indices (list or MXNet Array) – the indices used in slicing
mxfusion.util.util.rename_duplicate_names(names)

Given a list of names, rename the duplicated names by appending an integer at the end. This function returns a list of tuples each of which contains an index of the duplicate name and a new name. For example, [‘a’, ‘b’, ‘a’, ‘a’] -> [(2, ‘a0’), (3, ‘a0’)] [‘a’, ‘b’] -> []

Parameters:names ([str]) – the list of names
Returns:a list of tuples each of which contains an index of the duplicate name and a new name.
Rtypes:[tuple]
mxfusion.util.util.parse_string_to_tuple(s)