예제 #1
0
 public RaggedTensor(Tensor values,
                     bool @internal             = true,
                     RowPartition row_partition = null)
 {
     _values        = values;
     _row_partition = row_partition;
 }
예제 #2
0
 public static RaggedTensor from_row_splits(Tensor values, Tensor row_splits,
                                            string name = null, bool validate = true)
 {
     return(tf_with(ops.name_scope(name, "RaggedFromRowSplits"), scope =>
     {
         var row_partition = RowPartition.from_row_splits(row_splits,
                                                          validate: validate);
         return from_row_partition(values, row_partition, validate: validate);
     }));
 }
예제 #3
0
 /// <summary>
 /// Creates a `RaggedTensor` with rows partitioned by `value_rowids`.
 /// </summary>
 /// <param name="values"></param>
 /// <param name="value_rowids"></param>
 /// <param name="nrows"></param>
 /// <param name="name"></param>
 /// <param name="validate"></param>
 /// <returns></returns>
 public static RaggedTensor from_value_rowids(Tensor values, Tensor value_rowids,
                                              Tensor nrows = null, string name = null, bool validate = true)
 {
     return(tf_with(ops.name_scope(name, "RaggedFromValueRowIds"), scope =>
     {
         var row_partition = RowPartition.from_value_rowids(value_rowids,
                                                            nrows: nrows,
                                                            validate: validate);
         return from_row_partition(values, row_partition, validate: validate);
     }));
 }
예제 #4
0
 public static RaggedTensor from_row_partition(Tensor values, RowPartition row_partition, bool validate = true)
 {
     return(new RaggedTensor(values, @internal: true, row_partition: row_partition));
 }