Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for GetDataFormatPermutation (0.38 sec)

  1. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_layout_helper.h

    namespace mlir {
    
    class MLIRContext;
    
    namespace TF {
    
    SmallVector<int64_t, 4> ReversePermutation(ArrayRef<int64_t> permutation);
    
    SmallVector<int64_t, 4> GetDataFormatPermutation(StringRef from, StringRef to);
    
    // Shuffle elements in the `attr` according to the permutation. Optional
    // `inner_size` allows to shuffle array attributes created from rank 2 tensors
    // on outer dimension only.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 08 01:19:25 UTC 2023
    - 5.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_layout_helper.cc

      SmallVector<int64_t, 4> reverse(permutation.size());
      for (size_t i = 0; i < permutation.size(); ++i) {
        reverse[permutation[i]] = i;
      }
      return reverse;
    }
    
    SmallVector<int64_t, 4> GetDataFormatPermutation(StringRef from, StringRef to) {
      if (from == "NHWC" && to == "NCHW") {
        return {0, 3, 1, 2};
      } else if (from == "NCHW" && to == "NHWC") {
        return {0, 2, 3, 1};
      } else {
        return {};
      }
    }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tensorflow/transforms/layout_optimization.cc

        // Transpose arguments into the target data format.
        Permutation args_permutation =
            GetDataFormatPermutation(data_format, target_data_format);
    
        // Transpose results back to the original data format.
        Permutation res_permutation =
            GetDataFormatPermutation(target_data_format, data_format);
    
        if (args_permutation.empty() || res_permutation.empty()) return;
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 19.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_a_m.cc

    }
    
    LogicalResult Conv2DOp::verify() { return Verify(*this); }
    LogicalResult Conv3DOp::verify() { return Verify(*this); }
    
    LogicalResult Conv2DOp::UpdateDataFormat(StringRef data_format) {
      auto perm = GetDataFormatPermutation(this->getDataFormat(), data_format);
      if (perm.empty()) return failure();
    
      // Update data_format attribute and result types.
      if (failed(::mlir::TF::UpdateDataFormat(data_format, this))) return failure();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 146.7K bytes
    - Viewed (0)
Back to top